Help, maybe its an Angle Problem, but there should be a lot of solutes
I need some help, hope someone or Darren could help me, its for Fall Fu Template, but it is not a specific "problem" of that template, many people might have done something like this for a lot of games.
I need to make an Enemy, that you can kill (Fall over him, Like fall Fu Template) Only if you fall OVER him, and not by the side.
So, if you fall by the side and hit the enemy, you would die.
I Already have the Enemy Kill if you fall over him, but its just a collide rule.
Anyone have a good solution?
Cheers
I need to make an Enemy, that you can kill (Fall over him, Like fall Fu Template) Only if you fall OVER him, and not by the side.
So, if you fall by the side and hit the enemy, you would die.
I Already have the Enemy Kill if you fall over him, but its just a collide rule.
Anyone have a good solution?
Cheers
Comments
1) check to see if the self.Position.Y is above enemy.Position.Y
or
2) check to see if the distance between self.Position.X and enemy.Position.X is less than 15 pixels
or
3) check to see if vectorToAngle between self and enemy is greater than 45 and and less than 135
Thanks!