Page 1 of 1

HUMP timer and bump

Posted: Mon Mar 13, 2017 10:48 am
by WhiteLocke
I want to use the HUMP timer function

Code: Select all

Timer.during(delay, during, after)
but when I try to make they delay function a world:update() it says delay is nil. I think this is cause timer doesn't know what world is? Here's the code:

Code: Select all

Timer.during(1, world:update(player, x, y + 1), function ()
                      Timer.clear()
                      TimerOn = false
                      roomName = r.name
                      room_controller.lastDir = 'up'
                      return Gamestate.switch(overworld, "maps/".. roomName .. ".lua")
  end)
                end

Re: HUMP timer and bump

Posted: Mon Mar 13, 2017 12:42 pm
by WhiteLocke
Solved this one. Other tweaks aside, in this format, it needs to be surrounded by function() end. In other words: Timer.during(1, function() world:update(player, x, y + 1) end, etc. Also, had to include delta time (dt) to get what I was trying to do to work, but that's another issue.