Camera not moving right?

I’m trying to make a basic platformer game. However, in an EnterFrame event, it checks if the player’s x is above a certain value, and then calls the move function on the levelmap. However, it’s not moving the map right. Here’s a link to my code: http://db.tt/IqClXNp

Also, is it better to make my tiles physical with the HasBody and bodyType = static properties and then not have to worry about physical stuff, or to make objects which require a Body type and bodyType = static? I think in the long run after designing 20 levels having the tiles all physical would be easier, but idk. [import]uid: 8782 topic_id: 4688 reply_id: 304688[/import]

I think I have fixed your camera problem by adding the following code to the end of your object listener function onObject:

  
 local layerGroup = map:getLayer("Platforms").group  
 layerGroup:insert(player)  

All this does is get access to one of your Tiled layers (and its group object) and then insert the player object into it.

As for the physics question, the way I have been doing it is by building the platforms using Objects rather than individual tiles with HasBody, the reasoning for this is that with individual tile bodies for everything there would be a lot of physics objects in the world and I myself haven’t put any physics optimisations in for that many objects and not sure what, if anything, Corona does with physics bodies that aren’t on screen. [import]uid: 5833 topic_id: 4688 reply_id: 14927[/import]

Sweet, that solved it, thanks GrahamRanson! [import]uid: 8782 topic_id: 4688 reply_id: 14937[/import]

Awesome, glad it is working. [import]uid: 5833 topic_id: 4688 reply_id: 14954[/import]