Author Topic: Hero Run/Dash/Sprint  (Read 6743 times)

0 Members and 1 Guest are viewing this topic.

cabanas.ds

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Cabanas Beats Official Links
Hero Run/Dash/Sprint
« on: January 05, 2022, 05:34:25 PM »
Any idea how to get the hero to dash or run when holding the action button?

Spikira

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Hero Run/Dash/Sprint
« Reply #1 on: January 06, 2022, 05:22:12 AM »
There's a built in run function similar to the Zelda series. Just call 'game:set_ability("run", 1)' to enable running similar to that by holding the Action Button. If you want it on an item or something else, I believe it's 'hero:start_running()'.

cabanas.ds

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Cabanas Beats Official Links
Re: Hero Run/Dash/Sprint
« Reply #2 on: January 07, 2022, 02:49:09 PM »
There's a built in run function similar to the Zelda series. Just call 'game:set_ability("run", 1)' to enable running similar to that by holding the Action Button. If you want it on an item or something else, I believe it's 'hero:start_running()'.

Thank you, I will give this a go.

I have now realised since the space/action button has a sword power up i should add this to my Y button!

cabanas.ds

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Cabanas Beats Official Links
Re: Hero Run/Dash/Sprint
« Reply #3 on: January 10, 2022, 02:20:40 PM »

There's a built in run function similar to the Zelda series. Just call 'game:set_ability("run", 1)' to enable running similar to that by holding the Action Button.

just tried this, it's more of a running attack than a 'running boots' style dash.

kind of cool but still not dash.

cabanas.ds

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Cabanas Beats Official Links
Re: Hero Run/Dash/Sprint
« Reply #4 on: January 11, 2022, 03:16:35 PM »
I figured it out with help from discord folks.

-- Hero Dash when 'X' Held

function map:on_key_pressed(key)

if key == "x" then
sol.audio.play_sound("jump")
hero:set_walking_speed(200)

end end
function map:on_key_released(key)

if key == "x" then
hero:set_walking_speed(88)

end end
 

Spikira

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Hero Run/Dash/Sprint
« Reply #5 on: January 14, 2022, 07:41:24 AM »
Oh, you're making a increase walking speed kinda dash instead? OK. But if you want something akin to rolling in Minish Cap the link is here: https://forum.solarus-games.org/en/index.php/topic,1161.msg6851.html#msg6851