Results 1 to 9 of 9

Thread: small game map

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2006
    Posts
    419

    small game map

    hello.

    im trying to make a small game where you can walk around the map and collect things (using directx). the thing im stuck on is how do i create the map so the person can walk round?, how do i make a big map so when they move everything moves to them and they stay in the middle? or is this method bulit up pictures?

    Thanks
    lee
    If a post has been usefull then Rate it!

  2. #2
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: small game map

    Games like that are rarely created with graphics libraries. You're looking at just scrolling another picture behind the "player picture".

    Theres many examples on these forums, go searching.

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2006
    Posts
    419

    Re: small game map

    if there rarely created what is the best way to do this?
    If a post has been usefull then Rate it!

  4. #4
    Hyperactive Member singularis's Avatar
    Join Date
    Nov 2006
    Location
    Over There!
    Posts
    372

    Re: small game map

    What Chem was referring to would be a world editor. If you do not have time to write a world editor then try specifying and map purely though code in the form of a string.

    E.g.
    Code:
    Dim Map1 as String
    
    'W = water, L = Land
    Map1 = "WWWWWWWWL" &
    "WWLWWWWWL" &
    "WWWWWWWLL" &
    "WWWWWLWWL" &
    "WWWWWWWWL" &
    "WWWWWWWWL" &
    You could the read the string and build the map from that. That is, if you are doing a tile based map. The 'W's could represent a tile of water and the 'L's could represent a tile of land.
    If what I said was helpful, give me rep!

    My Complete Games: -- 2D Zone (Space Shooter game) || _2D Zone 2_ || Ninja Blob (2D platformer) || Dren (Co-op up to 4 player base defence game)

    My Projects: -- The Dread Engine (2D VB game Engine) || A* Path Finding


    An excellent site for learning DirectX7, 8 & 9 (for VB6, C# & VB.net) would be: directx4vb.vbgamer.com --- For my projects and games see: pieper.freehostia.com

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2006
    Posts
    419

    Re: small game map

    hmm, i understand where your coming from but im not sure how i would execute this say i have an image of green for land and then image of blue for water how will i know to say when i step forward or side to side move all the squares?
    If a post has been usefull then Rate it!

  6. #6
    Junior Member
    Join Date
    Mar 2007
    Location
    New Jersey
    Posts
    30

    Re: small game map

    Hi, this is my first post here, but I have been programming for a while so hopefully I can help you out.

    I'm assuming that you already have the tile image loaded into a texture, if not then I can explain how to do that. One way that you could do a map would be to have an open ended array that holds the tile type and 4 vertices. The vertices would be used to set up a quad (2 triangles that make a square), and with this quad you can render the texture to it. Code would look something like this:
    vb Code:
    1. type maptile
    2.     Texture as direct3dtexture8
    3.     Verts(3) as (vertex type)
    4. end type
    5. dim map() as maptile
    Then you have to set up the quad, which is just the 4 corners of a square. Remember to set the texture coordinates for the vertices so that the texture is rendered properly. Then to render:
    vb Code:
    1. for i = 0 to number of tiles
    2.     d3device.settexture 0, map(i).texture
    3.     d3device.drawprimitiveup triangle list, 2, map(i).verts, len(map(i).verts
    4. next i
    Thats just semi pseudo vb code, you would have to replace the variables, but that is the basic idea.

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2006
    Posts
    419

    Re: small game map

    ok, i think im going to learn a few more things before i start doing this as i think that would be best, im gonna keep the link to this safe so i can look back soon.

    thanks all
    lee
    If a post has been usefull then Rate it!

  8. #8
    Hyperactive Member singularis's Avatar
    Join Date
    Nov 2006
    Location
    Over There!
    Posts
    372

    Re: small game map

    hmm, i understand where your coming from but im not sure how i would execute this say i have an image of green for land and then image of blue for water how will i know to say when i step forward or side to side move all the squares?
    You don't, you move the squares relative to the players position but do not move the player. I don't suppose you have been to here

    @Binarycode: Thanks, but please do not post code that is mixed with pseudocode. It is just confusing
    If what I said was helpful, give me rep!

    My Complete Games: -- 2D Zone (Space Shooter game) || _2D Zone 2_ || Ninja Blob (2D platformer) || Dren (Co-op up to 4 player base defence game)

    My Projects: -- The Dread Engine (2D VB game Engine) || A* Path Finding


    An excellent site for learning DirectX7, 8 & 9 (for VB6, C# & VB.net) would be: directx4vb.vbgamer.com --- For my projects and games see: pieper.freehostia.com

  9. #9
    Junior Member
    Join Date
    Mar 2007
    Location
    New Jersey
    Posts
    30

    Re: small game map

    I'll try to keep that in mind it was just that something like the vertex type could be any of them and I didn't want to give him the impression that you had to use only one vertex type. Although looking at that I could have included some more information to make it more specific...

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