Enemy Shooting Back
CAmaninacan
Member Posts: 11
How do you make a enemy shoot at you and you lose one life if it hits you. And how do you make it rotate itself, so it can face you and shoot at you?
Thanks
Thanks
Comments
1) First, constrain two real attributes in the game attributes section to the X and Y position of your character. Have the bullet/laser/whatever either accelerate or move to those positions. Then create an integer attribute also in game attribute section with the number of lives you want as the value. Every time the bullet collides with your character, change the attribute to "game.lives -1). I recommend setting up a controller (an invisible, unmovable, uncollidable actor) to take care of this.
2) Simply use the same two attributes used to track your character's position and plug them in the "Rotate To" behavior.
Thanks
When "game.Lives" is less than 1
Change scene to "Game Over".
That'll change the scene when you run out of lives.
And under the Lives attribute, you set the value to something over 0, right?