Using sprites from a tileset

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.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Using sprites from a tileset

Post by Robin »

Okay, require "movement" at the top, instead of somewhere in the middle of your code. Secondly, love.load() is only called once, so the image and the quad aren't created. Lastly, you need to rename those functions in movement.lua, because they override the ones already defined. I suggest keeping a table with the callback functions for each state, so you can do things like:

Code: Select all

-- main.lua
function love.load()
    states = {}
    -- ...
end

function love.update(dt)
    states[state].update(dt)
end

Code: Select all

--movement.lua
states.game = {}
function states.game.update(dt)
     --blah
end
Help us help you: attach a .love.
Post Reply

Who is online

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