I want to create a system where the player will get knocked away from the enemy when they collide, relative to which direction the player comes from (e.g. the player is coming from the right when it hits the enemy, so it gets pushed left, etc)
<img src="http://imagizer.imageshack.us/v2/800x600q90/7/ul9r.png" border="0" />
How would one go about this?
Thanks : )
If you are using the platform behavior on the player, you can use the New Vector action adding or subtraction from vector x and vector y.
You should already have a instance variable on your player stating which direction they are going in, so based on that, you make the player get knocked back.
Here is a pretty crude example.
what movement type does your player have?
are you using platform behavior?
here is one I've done with the 8dir behavior
Thaks ArcadEd that helped a lot !!!!
Develop games in your browser. Powerful, performant & highly capable.