Main Menu
  • Welcome to The RPG Maker Resource Kit.

Multiple lives and player dying on touch

Started by kolkat, April 13, 2010, 07:21:31 PM

0 Members and 1 Guest are viewing this topic.

kolkat

Hi everyone,
I am trying to build a simple PRG with some arcade elements, and would like find a way to give the player a number of lives, which he/she would lose for certain things, such as touching some NPCs, or certain tiles (e.g. lava).

Every time a player dies, I would like him to reappear at the level entrance. I guess this can be done by using the transfer event but I am not sure how to let the character die more than once.

Thanks in advance!

Arrow

What you'll need to do is run some checks, and having branching statements based on them. Do the following with events, using conditional branches as necessary.




At the start of the game, set a variable named Lives (or something similar) to (whatever number of lives you choose.)

When the player enters the room, have an event that runs automatically store the player's x and y locations to two variables. (You should call them hero_x and hero_y)

When the player reaches an event that causes them to lose a life, you must tell the event to:

First, check the total number of lives.
Second, if it is greater than one...
1. - Decrease the total number of lives by one.
2. - Fade out the screen, and move the player to hero_x and hero_y.
3. - Fade the screen back in.
If your total number of lives is EQUAL to one...
1. - Go to game over.




If you need anything clarified, or you need help, I'm in IRC Chat. IRC is not normally used for help or troubleshooting but, eh, I make exceptions. :)

kolkat

Thanks a lot, that makes perfect sense!!!

Arrow

No problem amigo. :) If you want it to be a little less harsh on the player, you might have the game over check's number set to zero instead of one, making it work more similarly to games like megaman or mario.