Solarus-Games English Forum

Solarus => Development => Topic started by: yankscally on May 07, 2017, 11:21:32 PM

Title: hero hurt duration
Post by: yankscally on May 07, 2017, 11:21:32 PM
how do I make the duration of the hero hurt quicker? I want to have less time between enemy attacks but I can't seem to change that bit of code?
Title: Re: hero hurt duration
Post by: Zefk on May 08, 2017, 02:47:34 AM
http://www.solarus-games.org/doc/latest/lua_api_hero.html#lua_api_hero_start_hurt_entity

Use the hero:start_hurt([source_entity, [source_sprite]], damage) function and a timer.
http://www.solarus-games.org/doc/latest/lua_api_timer.html

Another option might be to use a timer in the code of your enemy script or change the speed of the enemy.
http://www.solarus-games.org/doc/latest/lua_api_target_movement.html#lua_api_target_movement_get_speed
Title: Re: hero hurt duration
Post by: Constantkaos on May 15, 2017, 04:56:16 AM
Just picked up aesprite today you guys are right tjhis program is awsome!!!!!!!!!!!!!definetley the way to go :D