Can we create a Level Editor via Corona GE?

this code keeps the circle in place with the world as it scrolls. note you were referencing the wrong object for now (map rather than map.world) so the scrolling broke

[lua]display.setStatusBar( display.HiddenStatusBar )

local lime = require(“lime”)

local tmap = lime.loadMap(“map.tmx”)

local circle = display.newImage(“circle.png”)
tmap:prepare()
local map = tmap.world

local defaultMoveSpeed = 4

local moveSpeed = defaultMoveSpeed

local groundLayer = tmap:getLayer(“Ground”)
groundLayer:insert(circle)

local onUpdate = function(event)

map.x = map.x - moveSpeed

if(moveSpeed > 0 and math.abs(map.x) >= map.width - display.contentWidth) then
moveSpeed = -defaultMoveSpeed
elseif(moveSpeed < 0 and map.x >= map.width - display.contentWidth * 2) then
moveSpeed = defaultMoveSpeed
end

end

local onTouch = function(event)

circle.x = event.x - map.x
circle.y = event.y - map.y
end
Runtime:addEventListener( “touch”, onTouch )
Runtime:addEventListener( “enterFrame”, onUpdate )[/lua] [import]uid: 6645 topic_id: 3534 reply_id: 10899[/import]

next step… findin an app that’ll let you draw an optimized box2d world over your tilemap :wink:

you wouldnt want to add physics to each sprite on the map presumably. and if it’s a large scrolling map that’s redrawn in portions… well that wouldnt even be able to tie directly into the tilemap. presumably the tilemap would have to be redrawn based on whats going on in the invisible physics world.

but anyway… back tomorrow

regards
J [import]uid: 6645 topic_id: 3534 reply_id: 10908[/import]

Yea I’m thinking stuff like that will be going in Coconut - http://grahamranson.co.uk/project-coconut.php - currently there is nothing to the project as I want to get Lime finished first.

Thanks for the help so far :slight_smile: [import]uid: 5833 topic_id: 3534 reply_id: 10910[/import]

this should help

using inkscape & tiled with box2d & cocos2d
http://www.youtube.com/watch?v=yvZM-YPPbII
[import]uid: 6645 topic_id: 3534 reply_id: 10911[/import]

Yea something like that would be great however I’ve never done any Mac development so wouldn’t even know where to begin with proper tool dev :slight_smile: [import]uid: 5833 topic_id: 3534 reply_id: 10912[/import]

Since tiled apparently can export an image of your map you can use that as a layer in inkscape to draw your world over. Then take the generated svg file to create your world in your game engine.

can I suggest that specific features of lime and coconut be modular is you can require only the bits you need. This is purely for keeping the elements needed down to a minimum to conserve memory on the phone

J [import]uid: 6645 topic_id: 3534 reply_id: 10958[/import]

Since tiled apparently can export an image of your map you can use that as a layer in inkscape to draw your world over. Then take the generated svg file to create your world in your game engine.

can I suggest that specific features of lime and coconut be modular ie you can “require” only the bits you need. This is purely for keeping the elements needed down to a minimum to conserve memory on the phone

J [import]uid: 6645 topic_id: 3534 reply_id: 10959[/import]

Yea I think Lime should purely be used for loading the static map and related properties and then Coconut would be used for the physics stuff.

Do you mean even more modular and split Lime up into smaller things? [import]uid: 5833 topic_id: 3534 reply_id: 10960[/import]

say the lime library code starts to get large then you could have

require(“lime”) – (lime.lua)

which loads (presuming for now we can use subfolders)…

lime/lime.base – loader etc
lime/lime.orthagonal
lime/lime.isometric
lime/lime.utils
lime/lime.scroller

but each of these could be loaded individually as required just to suit certain needs

of course there are 2 different kinds of scrolling… scrolling a whole map as one big display object, or using the delta scroll & redraw method, so essentially this could actually be split into 2 files too

in the end though it might only be a matter of a few KB difference so might not be worth the effort to separate them out

[import]uid: 6645 topic_id: 3534 reply_id: 10973[/import]

Currently Lime is about 12Kb so not too big so far but will certainly think about this when/if it get’s big however I think it will probably remain fairly small simply because there won’t be much more in it (famous last words :slight_smile: ) [import]uid: 5833 topic_id: 3534 reply_id: 10990[/import]