Author Topic: hero hurt duration  (Read 258 times)

yankscally

  • Newbie
  • *
  • Posts: 19
    • View Profile
hero hurt duration
« 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?

Zefk

  • Sr. Member
  • ****
  • Posts: 492
  • Just helping Solarus
    • View Profile
    • Zelzec Business
Re: hero hurt duration
« Reply #1 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
« Last Edit: May 08, 2017, 02:53:20 am by Zefk »

Constantkaos

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: hero hurt duration
« Reply #2 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