Results 1 to 3 of 3

Thread: How should i do this ?

  1. #1

    Thread Starter
    Lively Member slx47's Avatar
    Join Date
    Apr 2002
    Location
    US
    Posts
    127

    How should i do this ?

    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 ?

  2. #2
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    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:

    Code:
    '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
    that's how easy it is. Now you can add some check in your code like if actor.x > 600 then xscroll = xscroll +1

    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.
    Sanity is a full time job

    Puh das war harter Stoff!

  3. #3

    Thread Starter
    Lively Member slx47's Avatar
    Join Date
    Apr 2002
    Location
    US
    Posts
    127

    ok to draw the stuff

    would it be better to draw my tile in a picture box or use what directx gives ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width