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.

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 !
Posts: 104
Reputation: 1,761

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.
Posts: 24
Reputation: 1,009

Return to How do I....?

Who is online

Users browsing this forum: dioking, JayH, urkokan and 21 guests