Voxel Game Maker

Docs Cookbook

Dash

Open Game Settings ▸ Combat and tick Dodge roll.

#Without code

  1. Open Game Settings ▸ Combat and tick Dodge roll.
  2. Set Dodge cost (stamina per dash) and Dodge speed.
  3. Try it: press ▶ Play and press Ctrl while moving: the player dashes and is safe for a moment.

#Quick code

Where it goes: a level script, Event: Player enters the level; Q dashes, once a second.

local ready = 0
while true do
  ready -= dt()
  if key_pressed("Q") and ready <= 0 then
    launch("forward", 16)
    play("zap")
    ready = 1
  end
  wait(0)
end