Hello! What would be the command to restore all life when you pick up a heart container? I know the logic but not the command = /
Quote from: Tulk on June 21, 2017, 11:24:23 PM
Hello! What would be the command to restore all life when you pick up a heart container? I know the logic but not the command = /
Ahoy there! There is not a single command to do that.
But if you already know the logic, you can easily do it.
You will find here the tools and commands that you may need:
http://www.solarus-games.org/doc/1.5/lua_api_game.html
The rest is just Lua, but I leave it as a programming exercise for you. ;)
PS: you can also find the code you need in any Solarus game made by Christopho. :)
Some important functions from the documentation to know.
http://www.solarus-games.org/doc/1.5/lua_api_game.html#lua_api_game_set_max_life
http://www.solarus-games.org/doc/1.5/lua_api_game.html#lua_api_game_get_max_life
http://www.solarus-games.org/doc/1.5/lua_api_game.html#lua_api_game_get_life
http://www.solarus-games.org/doc/1.5/lua_api_game.html#lua_api_game_set_life
Example:
game:set_max_life(12)
game:set_life(game:get_max_life())
Thank you guys! \o