Solarus-Games English Forum

Solarus => Development => Topic started by: Yeury on November 04, 2017, 07:25:41 AM

Title: Changing Hero on death behavior?
Post by: Yeury on November 04, 2017, 07:25:41 AM
What script handles what happens when the hero dies? Right now what happens is basically the map restarts and my hero's health is restored but I would like to teleport him to another map upon death.
Title: Re: Changing Hero on death behavior?
Post by: Christopho on November 04, 2017, 12:19:48 PM
You can define the event game:on_game_over_started() to do what you want instead of just restarting the game (which is the default).
See http://www.solarus-games.org/doc/1.5/lua_api_game.html#lua_api_game_on_game_over_started