1
\$\begingroup\$

I'm reading the Love2D Development book, which i think i will stop reading because is outdated and very instable, sometimes i got a lot of troubles. Backing to the question, i made a tileset map with Tiled and saved in .tmx with Base64 ( uncompressed ) then i used Advanced-Tiled-Loader and used the code from the book:

-- This is the main.lua file --

local loader = require ("Advanced-Tiled-Loader-master/Loader")

---the path to our .tmx files and sprites

loader.path = "map/"

local map = loader.load("tilemap.tmx")

function love.load()

    love.graphics.setBackgroundColor(255, 153, 0)

    --- load the level and bind the variable map

    loader.path = "map/"

    local map = loader.load("tilemap.tmx")
end

function love.draw()

    map:draw()

end

When i tested the game, the result was this:

http://i.imgur.com/JM8EYrv.png

The result was suposted to be like this:

http://i.imgur.com/W26XFjE.png

So what it could be?

\$\endgroup\$
  • 1
    \$\begingroup\$ You should probably take a screenshot instead of a picture of your screen. These pictures are pretty blurry. \$\endgroup\$ – Heckel Aug 5 '14 at 2:30
  • \$\begingroup\$ yeah, i couldn't take screenshot, i will try to fix it.. \$\endgroup\$ – RebeloX Aug 5 '14 at 2:42
  • \$\begingroup\$ @BlueX Almost universal screenshot how-to. \$\endgroup\$ – Anko Aug 5 '14 at 11:49
  • \$\begingroup\$ @Anko Thanks dude, i already upload the images and edited the question.. \$\endgroup\$ – RebeloX Aug 5 '14 at 22:44
  • 1
    \$\begingroup\$ Did you place the tilesheet you used in the map folder? Also ATL is a bit old, better to use; love2d.org/forums/viewtopic.php?f=5&t=76983 \$\endgroup\$ – dan369 Aug 6 '14 at 0:35
0
\$\begingroup\$
-- This is the main.lua file --

local loader = require ("AdvTiledLoader/Loader")

---the path to our .tmx files and sprites
local map = nil;

function love.load()

    love.graphics.setBackgroundColor(255, 153, 0)

    --- load the level and bind the variable map

    loader.path = "maps/"

    map = loader.load("test.tmx")
end

function love.draw()

    map:draw()

end

So using my copy of ATL, and just making a quick test tiled map, this code worked fine. Using base64. Should look like; http://i.imgur.com/esHoetm.png

Result; http://i.imgur.com/pOX8M0m.png

Map: http://pastebin.com/k05iHYhs & my test sheet; http://i.imgur.com/j2SuFcX.png

For clarity & any future reference ATL is a bit outdated, doesn't support polygons/polylines that are available in Tiled. It does however support older versions of LOVE. Whereas the atlernative; STI requires LOVE 0.9.1 but does provide updated support (Link)

\$\endgroup\$
  • \$\begingroup\$ I used your code and it works, probably it is some error that i got from the tmx file. About the STI, my computer doesn't support OpenGL 2.1+ , so i can't use that library. \$\endgroup\$ – RebeloX Aug 8 '14 at 17:28
  • \$\begingroup\$ Ah well glad I could help :). \$\endgroup\$ – dan369 Aug 8 '14 at 21:05
  • \$\begingroup\$ I created a tileset with your tile image and it worked, but when I use the other image it goes crazy, like that image that i have shown. What it could be? Could I be setting someting wrong in Tiled? \$\endgroup\$ – RebeloX Aug 8 '14 at 21:59
  • \$\begingroup\$ What is your tile-size? It could be that (from your previous image it saw your ts as 16x16 (my guess) whereas i've only tried ATL with 32x32 tiles). \$\endgroup\$ – dan369 Aug 9 '14 at 2:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.