Top down shooter / recoil

0 favourites
  • 2 posts
From the Asset Store
Cannon Ball Shooter game assets for 2D bubble shooter puzzle game.
  • 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.

    scirra.com/forum/topic68471_post420886.html

    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 !

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)