ok i am using directx8 to make my game. I want to make a tile engine and im not sure how to start. I want to have a character move around on the screen and when he gets to edge the world moves. Anyone know how to do something like this ?
Printable View
ok i am using directx8 to make my game. I want to make a tile engine and im not sure how to start. I want to have a character move around on the screen and when he gets to edge the world moves. Anyone know how to do something like this ?
it is not quite clear to me what exactly is your problem, but as far as I interpreted it you know how to set up DX8 and draw stuff.
So you are basically asking for the basics of a tile engine.
basically you draw like this in a tile engine:
that's how easy it is. Now you can add some check in your code like if actor.x > 600 then xscroll = xscroll +1Code:'this is pseudo code
for x = 0 to 10
for y = 0 to 10
draw x*width,y*height,Tile(map(x,y)
next y
next x
'this would give you a static tile engine now let's add some scrolling
for x = 0 to 10
for y = 0 to 10
draw x*width,y*height,Tile(map(x+scrollX,y+ScrollY)
next y
next x
alright this is the basics. It will give you scrolling by the tile, if you need to scroll by pixel you need to set another offset where the x and the y value in the drawing goes...
alright give this a thought and post if you have more questions about it.
would it be better to draw my tile in a picture box or use what directx gives ?