Help with use of Tiled

I’ve started working on a 2D maze game with use of Tiled but can’t seem to get things to run smoothly.

The following is how it appears in Tiled:

YPxrhgk.png

But then when I run the simulator I get this and the following messages below:

HIAJIvQ.png

[spoiler]20:14:17.481 Windows simulator build date: Mar 31 2017 @ 14:34:46
 
20:14:17.481

20:14:20.303
20:14:20.303 Copyright © 2009-2017 C o r o n a L a b s I n c .
20:14:20.303 Version: 3.0.0
20:14:20.303 Build: 2017.3068
20:14:20.303 Platform: iPhone / x64 / 6.1 / AMD Radeon HD 6410D / 4.1.10834 Compatibility Profile Context / 2017.3068 / en_CA | CA | en_CA | en
20:14:20.303 Loading project from: F:\Corona Projects\Rustic Maze
20:14:20.303 Project sandbox folder: C:\Users\Daniel\AppData\Local\Corona Labs\Corona Simulator\Sandbox\rustic maze-7619BCB584A0B3767A6B964C2C1AD684\Documents
20:14:20.323 LOADED: scene/levels/…/graphics/blocks.png
20:14:20.333 WARNING: Supplied frameIndex(3) exceeds image sheet’s maximum frameIndex (2). Value will be clamped.
20:14:20.333 WARNING: Supplied frameIndex(3) exceeds image sheet’s maximum frameIndex (2). Value will be clamped.
20:14:20.333 WARNING: Supplied frameIndex(3) exceeds image sheet’s maximum frameIndex (2). Value will be clamped.
20:14:20.333 WARNING: Supplied frameIndex(3) exceeds image sheet’s maximum frameIndex (2). Value will be clamped.
20:14:20.333 WARNING: Supplied frameIndex(3) exceeds image sheet’s maximum frameIndex (2). Value will be clamped.
20:14:20.333 WARNING: Supplied frameIndex(3) exceeds image sheet’s maximum frameIndex (2). Value will be clamped.
20:14:20.333 WARNING: Supplied frameIndex(3) exceeds image sheet’s maximum frameIndex (2). Value will be clamped.
20:14:20.333 LOADED: scene/levels/…/graphics/gem.png
20:14:20.333 WARNING: Supplied frameIndex(2) exceeds image sheet’s maximum frameIndex (1). Value will be clamped.
[/spoiler]

I’ve also included my code if that helps:

[spoiler][lua]local tiled = require “com.ponywolf.ponytiled”;
local physics = require “physics”;
local json = require “json”;
local composer = require “composer”;

physics.start();

local map;

local scene = composer.newScene();

function scene:create(event)
 local sceneGroup = self.view;
 
 local mapData = json.decodeFile(system.pathForFile(“scene/levels/ruins-1.json”, system.ResourceDirectory));
 map = tiled.new(mapData, “scene/levels”);

 map.x = display.contentCenterX - 160;
 map.y = display.screenOriginY;
end

function scene:show( event )
 local sceneGroup = self.view;
 local phase = event.phase;
 
 if phase == “will” then

 elseif phase == “did” then

 end
end
 
function scene:hide(event)
 local sceneGroup = self.view;
 local phase = event.phase;
 
 if phase == “will” then

 elseif phase == “did” then

 end
end

function scene:destroy(event)
 local sceneGroup = self.view;
end

scene:addEventListener(“create”, scene);
scene:addEventListener(“show”, scene);
scene:addEventListener(“hide”, scene);
scene:addEventListener(“destroy”, scene);

return scene[/lua][/spoiler]

Any ideas on how to stop this from happening?

Thanks

This happened to me a couple times. If remember correctly, it was due to the margin and or spacing values from tiled. You can edit these values via tiled or directly editing the tmx or json file.

What do I change them to though? Right now all of my margin and spacing values are 0 with 32x32 tiles. I also only have one 32x32 tile per tileset and image file.

EDIT: Nevermind actually. I switched to the method Sticker Knight uses (tileset via adding individual images instead of tileset for each image) and it works!

Sorry I missed this. Glad you got it working!

This happened to me a couple times. If remember correctly, it was due to the margin and or spacing values from tiled. You can edit these values via tiled or directly editing the tmx or json file.

What do I change them to though? Right now all of my margin and spacing values are 0 with 32x32 tiles. I also only have one 32x32 tile per tileset and image file.

EDIT: Nevermind actually. I switched to the method Sticker Knight uses (tileset via adding individual images instead of tileset for each image) and it works!

Sorry I missed this. Glad you got it working!