HUMP timer and bump

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
WhiteLocke
Prole
Posts: 7
Joined: Tue Feb 21, 2017 11:45 am

HUMP timer and bump

Post 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
WhiteLocke
Prole
Posts: 7
Joined: Tue Feb 21, 2017 11:45 am

Re: HUMP timer and bump

Post 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.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 4 guests