support infinite tiled map ?

will lime support infinite tiled maps , i.e. map1, map2, map3, map1, map2 … and so on…
e.g. Canabalt, NinJump etc [import]uid: 12088 topic_id: 10964 reply_id: 310964[/import]

I was thinking about how to go about this as well. I attempted to use Lime to replace my existing setup of spawning static physics platforms, scrolling it, and destroying them if they went off screen and respawning the next platform off screen.

Having some troubles with the maps in Lime though.

I did the following

local map = lime.loadMap (tmxRegistry[1]); // a tmx file from a table  
local visual = lime.createVisual (map);  
local physical = lime.buildPhysical (map);  
  
map:disableScreenClamping (); // without this, the map is locked to the screen  
map:setPosition (0, 100); // position it  
environmentGroup:insert (visual); // add the visual to a predefined layer  

What happens is the visual moves but the physics object doesn’t seem to move along with it. I might be going about it the wrong way though! [import]uid: 63884 topic_id: 10964 reply_id: 39912[/import]

I started implementing a feature called Atlas that allows you to string maps together, this way you could string 2 or 3 identical maps and then reposition them to make it infinite or just string together a bunch of different maps. It worked pretty well at last check however it was stopped once I hit upon a physics problem, the same problem you have now hit.

Basically all physics objects need to be in the same co-ordinate system so either all in the same group or separate groups that don’t move independently, this stops Atlas from working.

What we really need is for Corona to be able to deal with physics in separate groups or to allow us to separate physics from visual, i.e. all visuals would be in separate groups/layers just like they are now but all physics bodies would be in one single group. [import]uid: 5833 topic_id: 10964 reply_id: 39935[/import]

Gotcha. So if I understand correctly …

  • Corona (as of yet) provides no way to move (or deal with) with the physics layer in a tilemap. Applying the move function to a map does not move its physics body in a manner that other physics bodies outside of the tilemap can interact with.

  • I either have to perform all my game physics WITHIN a single tilemap (which would not work well for a dash-style game), or hold off on Lime and wait for a solution to the physics/groups issue. [import]uid: 63884 topic_id: 10964 reply_id: 39937[/import]

For anyone else interested, found this thread regarding the issue :

https://developer.anscamobile.com/forum/2010/09/17/moving-objects-group-collision [import]uid: 63884 topic_id: 10964 reply_id: 39949[/import]

You can move the map with physics however if the layers move independently such as with Atlas or parallax then you will hit upon the problem.

At present I am unsure of a way around this. [import]uid: 5833 topic_id: 10964 reply_id: 39950[/import]

It’s possible? Hmm. Let me better explain how I was trying to implement it :

Background -> sprites that move at different ratios to simulate parallax (not using Lime)
Player object -> instance of sprite in Corona
Tilemaps -> Randomly load with Lime, use it as platforms by giving valid tiles an “isGround”, HasBody, and bodyType = “static” property and checking for it with a onCollision function

The problem I have is calling map:setPosition() or map:move() moves the visual layer but the invisible static layer remains in place. [import]uid: 63884 topic_id: 10964 reply_id: 39952[/import]

The map:move() and map:setPosition() and all other similar functions will only work on objects that have been added to the map. You can add a displayObject to the map by either using the map:addObject( displayObject ) function or using the pair addObject() functions on a tileLayer of objectLayer object. [import]uid: 5833 topic_id: 10964 reply_id: 40199[/import]

The Lime feature called Atlas is released in current version? although it cannot work with physics layer, I don’t care about it. [import]uid: 12088 topic_id: 10964 reply_id: 47032[/import]

Atlas is in but it hasn’t been modified for a while and it is basically an undocumented feature due to the limitation/bug/design choice with the physics engine about bodies in separate groups. Once that is resolved it will make alot of things easier. [import]uid: 5833 topic_id: 10964 reply_id: 47657[/import]

Any update on this particular thread? From my experience, even if you can move physics objects you’ll still run into considerable framerate issues. [import]uid: 8545 topic_id: 10964 reply_id: 57639[/import]

Nothing new really at present, I haven’t had much time to think about Atlas for a while. I’m hoping that the performance/graphics system improvements that Ansca are now saying will be in the next drop ( they were pushed back during the last one ) will help in some way. Fingers crossed. [import]uid: 5833 topic_id: 10964 reply_id: 58264[/import]

Since I’m relatively new to the Corona forums… what exactly is a “Drop?” Are you referring to the daily builds? [import]uid: 49447 topic_id: 10964 reply_id: 59155[/import]

Sorry by that I meant the next full release of a new Corona version. Not sure if drop is the correct terminology or even why I used it, it sorta just came out. [import]uid: 5833 topic_id: 10964 reply_id: 59202[/import]