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:

https://i.sstatic.net/bVRpl.png

The result was suposted to be like this:

https://i.sstatic.net/0dcUS.png

So what it could be?

\$\endgroup\$
6
  • 1
    \$\begingroup\$ You should probably take a screenshot instead of a picture of your screen. These pictures are pretty blurry. \$\endgroup\$
    – Heckel
    Commented Aug 5, 2014 at 2:30
  • \$\begingroup\$ yeah, i couldn't take screenshot, i will try to fix it.. \$\endgroup\$
    – RebeloX
    Commented Aug 5, 2014 at 2:42
  • \$\begingroup\$ @BlueX Almost universal screenshot how-to. \$\endgroup\$
    – Anko
    Commented Aug 5, 2014 at 11:49
  • \$\begingroup\$ @Anko Thanks dude, i already upload the images and edited the question.. \$\endgroup\$
    – RebeloX
    Commented Aug 5, 2014 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
    Commented Aug 6, 2014 at 0:35

1 Answer 1

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; https://i.sstatic.net/do7XH.png

Result; https://i.sstatic.net/iqCPk.png

Map: http://pastebin.com/k05iHYhs & my test sheet; https://i.sstatic.net/zDAdv.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\$
4
  • \$\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
    Commented Aug 8, 2014 at 17:28
  • \$\begingroup\$ Ah well glad I could help :). \$\endgroup\$
    – dan369
    Commented Aug 8, 2014 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
    Commented Aug 8, 2014 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
    Commented Aug 9, 2014 at 2:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .