Is it possible to make my enemy to get pushed back smoothly like 7 pixels when hit by a bullet?
Is there even a plugin for this??
I want the enemy to get pushed back 180 degrees from the angle it was shot.
Here is one approach:
http://www.scirra.com/forum/how-to-make-a-simple-sprite-knockback-in-8-dir_topic53242.html
I did that but it pushes towards me instead of away from me :/ What did I do wrong?
I use bullet behaviour for it to move towards me regularly. And I tried to disable that so they won't follow me anymore and then it works. Can I fix this somehow without using Custommovement?
condolent You need to look at the direction the bullet is traveling and base the amount of pixels you are moved off of that. Maybe on collision you check to see if the players X or Y coordinate (depending on which direction your game goes) and if it is greater than or less than the X or Y coordinate of the player, move them + or - 7 pixels as needed....
That only works if it's a platform game, doesn't it?
Because I'm not making a platform game. More like a top-down shooter
Nope that Method should work exactly the same for the Top down shooter except of course that it wont appear the same....because of the viewpoint..the mechanic is the same the visuals arent but if it was me i would combine the bullet effect with an animation that is called just prior to the Knockback mechanic...this will increase the illusion of knockback if you make your animation believable as well...
Develop games in your browser. Powerful, performant & highly capable.
Here is one approach that I actually did as an example for few other questions:
Bang bang example