Code
Unit To Mouse
Events
UI - Player Any Player clicks Left mouse button Down.
Local Variables
Start = (Position of Marine [129.69, 133.54]) <Point> // The unit chosen should be your hero
Current Position = No Point <Point>
Distance = 0.5 <Real>
Conditions
Actions
General - While (Conditions) are true, do (Actions)
Conditions
Distance < (Abs((Distance between (Point((Mouse X position clicked in the world), (Mouse Y position clicked in the world))) and Start)))
Actions
General - Wait 0.05 Game Time seconds // This is optional as it controls how long to wait before creating each explosion
Variable - Set Current Position = (Start offset by Distance towards (Angle from Start to (Point((Mouse X position clicked in the world), (Mouse Y position clicked in the world)))) degrees)
Environment - Create a Large Terran explosion at Current Position
Variable - Modify Distance: + 0.5
General - If (Conditions) then do (Actions) else do (Actions)
If
Distance >= (Abs((Distance between (Point((Mouse X position clicked in the world), (Mouse Y position clicked in the world))) and Start)))
Then
Variable - Set Current Position = (Point(0.0, 0.0))
Variable - Set Distance = 0.5
Else
Events
UI - Player Any Player clicks Left mouse button Down.
Local Variables
Start = (Position of Marine [129.69, 133.54]) <Point> // The unit chosen should be your hero
Current Position = No Point <Point>
Distance = 0.5 <Real>
Conditions
Actions
General - While (Conditions) are true, do (Actions)
Conditions
Distance < (Abs((Distance between (Point((Mouse X position clicked in the world), (Mouse Y position clicked in the world))) and Start)))
Actions
General - Wait 0.05 Game Time seconds // This is optional as it controls how long to wait before creating each explosion
Variable - Set Current Position = (Start offset by Distance towards (Angle from Start to (Point((Mouse X position clicked in the world), (Mouse Y position clicked in the world)))) degrees)
Environment - Create a Large Terran explosion at Current Position
Variable - Modify Distance: + 0.5
General - If (Conditions) then do (Actions) else do (Actions)
If
Distance >= (Abs((Distance between (Point((Mouse X position clicked in the world), (Mouse Y position clicked in the world))) and Start)))
Then
Variable - Set Current Position = (Point(0.0, 0.0))
Variable - Set Distance = 0.5
Else
If you need anything clearified please ask.
Attachments:
Post has been edited 1 time(s), last time on May 14 2010, 11:55 pm by Morphling.
None.