Game Development Reference
In-Depth Information
When the player presses the attack button and the actor isn't flipped (so he'll be
facing the right end of the screen), animate accordingly, and then spawn the actor in
front of the player.
Then, in the detector actor you spawn when attacking, have it automatically
destroyed when the player has finished animating.
Also, throw in a Move behavior, especially when there is a down swipe such as the
attack. For this example, you'll want a detector to follow the edge of the blade. This
way, all you have to do is detect collisions inside the enemies with the detector actor.
It is way more accurate to do things this way; in fact you can even do collisions
with walls. Let's say the actor punches a wall and this detector collides with the
block, spawn some particles for debris, and change the image of the block into a
cracked image.
There are a lot of cool things you can do with melee weapons and with ranged
weapons. You can even have the wall pieces have a sort of health bar, which is really
a set amount of times a bullet or sword will have to hit it before it is destroyed.
That's all we are going to do in this chapter, but hey, we accomplished a lot! Kevin is
now bouncing around our level, running like a silly little boy, and now he can shoot
things up.
 
Search WWH ::




Custom Search