Created
July 16, 2011 00:27
-
-
Save GloryFish/1085835 to your computer and use it in GitHub Desktop.
Tiled loading code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- scene_tiled.lua | |
-- The-Road | |
-- | |
-- Created by Jay Roberts on 2011-07-15. | |
-- Copyright 2011 GloryFish.org. All rights reserved. | |
-- | |
require 'logger' | |
require 'level' | |
require 'camera' | |
require 'player' | |
require 'vector' | |
require 'textfader' | |
require 'colors' | |
tiled = Gamestate.new() | |
function tiled.enter(self, pre) | |
local loader = require('AdvTiledLoader/loader') | |
self.map = loader.load('/resources/maps/tiledtest.tmx') | |
for k, layer in pairs(self.map.tilelayers) do | |
if layer.use_batch ~= use_batch then | |
layer.use_batch = use_batch | |
map:forceRedraw() | |
end | |
end | |
end | |
function tiled.keypressed(self, key, unicode) | |
if key == 'escape' then | |
self:quit() | |
end | |
end | |
function tiled.mousepressed(self, x, y, button) | |
end | |
function tiled.mousereleased(self, x, y, button) | |
end | |
function tiled.update(self, dt) | |
end | |
function tiled.draw(self) | |
self.map:draw() | |
end | |
function tiled.quit(self) | |
love.event.push('q') | |
end | |
-- set unused objects to nil so they can be garbage collected | |
function tiled.leave(self) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment