How to get an arc, half turn, 3/4 turn for an enemy in a vertical shooter
jasdip
Member, PRO Posts: 7
Hi,
I am working on a vertical shooter and have various actors that fly from the top of the screen towards varying x,y coords on the screen, the enemy ships then rotate and fly to another x,y coord that I specify. I have this working through the use of a couple of move to and rotate position behaviours, however, even though I am pleased to get this working I would like to get more of an arc working when the ship turns to its new x,y coord. I've been looking at various sin & cos expressions and math formulas placed on the forums but i am just not getting it. Any advice on how to achieve an arc, half turn, 3/4 turn would be appreciated.
I am working on a vertical shooter and have various actors that fly from the top of the screen towards varying x,y coords on the screen, the enemy ships then rotate and fly to another x,y coord that I specify. I have this working through the use of a couple of move to and rotate position behaviours, however, even though I am pleased to get this working I would like to get more of an arc working when the ship turns to its new x,y coord. I've been looking at various sin & cos expressions and math formulas placed on the forums but i am just not getting it. Any advice on how to achieve an arc, half turn, 3/4 turn would be appreciated.
Comments
Experiment with something like this:
When mousedown
-- Rotate To Position
---- Position ^: game.Mouse.Position.X
---- Position>: game.Mouse.Position.Y
---- Offset Angle: 0
---- Speed: 180
---- Relative to: scene
---- Run to completion:√
---- Stops on destination:√
-- Timer, Every .05 seconds, Run to Completion:√
---- Change Velocity
------ Direction: 0
------ Relative to: actor
------ Speed: 90
Lump Apps and My Assets