Top down shooter / recoil

Get help using Construct 2

Post » Thu May 30, 2013 8:31 pm

hello ! im working on a topdown shooter type "hotline miami"

i would like the monster to be pushed away by the bullets
so i need to use the angle og the arriving bullet to push the monster in the right direction.

but i dont know how.

i've seen this post but i dont know how to use this method.

http://www.scirra.com/forum/topic68471_post420886.html#420886


VectorX = ImpulseStrength * -cos(Angle)
VectorY = ImpulseStrength * -sin(Angle)


where to define impulsestrenght ?   
if i use a number it doesnt work neither
for the angle i used (bullet.angle)   but i dont know if its good because it didnt work.



precision : my monster are moved by pathfinding o they dont have neither 8 direction neither platform.


thanks for answers !
B
18
S
3
Posts: 99
Reputation: 1,376

Post » Thu May 30, 2013 10:39 pm

Give your monsters 8-direction, then in the Monster properties for 8-direction, set default controls to "No."

When a bullet collides with a monster, set the monster's speed and angle to the bullet's.

I am not sure about how to adjust the length of the knockback or how to prevent the same bullet from triggering multiple times per bullet (the simplest solution would be to destroy the bullet X*dt after collision.
B
16
S
3
Posts: 24
Reputation: 859


Return to How do I....?

Who is online

Users browsing this forum: Alex Bryant, Congrats2u, kiko2015, Moordhuis, omnipaws, R0J0hound, tarek2 and 12 guests