Place Character into Map

Hi, i am working on a Tile based Game at the Moment. I have the characters and Entity’s all added but I don’t know how to place them inside of the map, while making it scroll when my character moves.
Could someone please help me by telling me what I have to change? I don’t want the exact answer but just a tip on how to achieve it :slight_smile:

If someone has a bit of time left over to help, id really appreciate it!

Since my Code is pretty long ill add the file here:

https://rapidshare.io/35QA/Game.zip

Generally, for 2D tile games, you have a 2D array of what the ground tiles are for each area/level.

Then you would loop over the area in that level that’s on the screen currently, and draw each of those ground elements (0 is a space, for example, 1 is grass, 2 is stone, 3 is a wall, 4 is a breakable wall, 5 is a broken wall, etc etc).

Once those are all drawn, you then draw the enemies and play characters on to of that. Draw the hero’s sprite at the right place. Draw the enemies and collectables.

1 Like

well I do have the map in the background but if I put my player coordinates to the start tile it doesn’t change anything. Like my Character flies over the map but doesn’t start inside. I think if I get the starting point with the scrolling right, I can figure out how to not make it leave the map. Since we need to have a background behind the map… I don’t know if my explanation just made sense haha I am sorry

I am currently just stuck on how to place my character inside of the map, no matter what I do he’s always outside or I can’t move him anymore and he’s stuck in that place.