It’s really not hard to do without Lime (although it may be easier with Lime).
- Create tiles (32x32, 48x48 or whatever size tiles you want for your game.
- Create your level(s) using those tiles
- Put all of the tiles in a sprite sheet (TexturePacker is great for this).
- Load tile image data so you can do newSprite() as needed.
- Load level data (just (level width)*(level height) tiles)
- For each tile in the level create a sprite using your sprite sheet and position it at the appropriate x,y (see note below to optimize this)
- Create player sprite and position it in the level
- As player moves to left/right edge, start scrolling tiles by changing their X,Y (see note below to optimize this)
NOTE: If you add each tile to a group with the appropriate X,Y, then when it comes time to scroll the tiles left/right/up/down you can just change the group.x, group.y values to offset all of the tiles. Assuming your player can move independently in a “center” region without causing the level to scroll, then you want to make sure the sprite for the player is NOT part of the level group.
Obviously this is a very high level overview of how to do it, but it can be done along these lines. Also, if you want foreground/background tiles, you can create separate “planes” for each layer; just put the tile sprites in their own groups so you can move different layers at different rates which gives you parallax scrolling.
Hope that helps. [import]uid: 16734 topic_id: 19640 reply_id: 75910[/import]