User clicks with left button (That means fire)
-Create Bullet at (0;0) from Player
-Bullet: Set alterable A to Angle("Player")
-Bullet: Set alterable B to X("Player")
-Bullet: Set alterable C to Y("Player")
Number of bullets > 0
-Start loop "bullet" 30 times (Or more, if you want faster bullets)
On loop "bullet"
-Bullet: Set value B to value B("Bullet") + Cos(Value A("Bullet"))
-Bullet: Set value C to value C("Bullet") + Sin(Value A("Bullet"))
-Bullet: Set X position to value B("Bullet")
-Bullet: Set Y position to value C("Bullet")
On loop "bullet" Bullet collides with backdrop
-Bullet: Destroy
... And so on. I used alterable values because they allow decimals, so it's more accurate than just adding directly to the X and Y position.
If the bullets turn with the player, you've done something wrong.
When the player fires, you should set the bullet's alterable value A (or whatever) to the angle of the player. Then calculate the X and Y position of the bullet NOT from the player's angle directly, but from the bullet's value A.
Works now.. i had moved the hotspot of the bullet to make it better look as it came frmo the barrel.. somehow that interfered and i had to do a few extra calculations.
Edited by the Author.
- Eternal Life, Or Your Money Back -
http://www.befun.dk/
Currently looking for a home (team)