Results 1 to 7 of 7

Thread: Game

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2006
    Posts
    27

    Game

    Hi All,

    Please will anyone be able to help me get this game working in VB?

    Game

    A red wildebeest is controlled by the player - it can move up, down, left, right, and the aim is to eat all the green grass, leaving red soil behind. The game ends when all the grass is successfully eaten. Unfortunately, the ground is unsafe, and holes - black squares - pop up every 4 moves, at a random position. The game also ends when the wildebeest falls into a hole.

    • the game is played on a 10 by 10 area
    • it should display a count of the number of moves, and of the number of holes created.
    • I need to use a 2-dimensional array to hold details of the current state of the game, using characters to represent each square, as in

    dim board(9,9) as string ' 0 to 9 - global

    for row = 0 to 9
    for col = 0 to 9
    board(row,col) = "g" 'use g for grass
    next
    next

    Thanks

  2. #2
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: Game

    This...

    VB Code:
    1. for row = 0 to 9
    2. for col = 0 to 9
    3. board(row,col) = "g" 'use g for grass
    4. next
    5. next
    ...can be done withouth the double for next loop. index is always the same.

    VB Code:
    1. for row = 0 to 9
    2. board(row,row) = "g" 'use g for grass
    3. next
    What is actually the problem?

  3. #3
    Junior Member
    Join Date
    Apr 2006
    Posts
    26

    Re: Game

    Can i just make a suggestion man -- and i'm sure it wont have anything to do with what you want

    Make the game in flash -- that way people will get to play it online, without downloading a suspisious ".exe" file.

    Actionscript isnt too hard to learn, and its perfect for game makers, as your work can be played by anyone, no downloading.

  4. #4

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Game

    Moved to Games Programming

  6. #6
    Addicted Member
    Join Date
    Feb 2006
    Location
    The Sea of Tranquility
    Posts
    252

    Re: Game

    Quote Originally Posted by gavio
    This...

    VB Code:
    1. for row = 0 to 9
    2. for col = 0 to 9
    3. board(row,col) = "g" 'use g for grass
    4. next
    5. next
    ...can be done withouth the double for next loop. index is always the same.

    VB Code:
    1. for row = 0 to 9
    2. board(row,row) = "g" 'use g for grass
    3. next
    What is actually the problem?
    The second will only fill the diagonal with "g"'s. You still need the nested loops.

    as for my advice http://www.codeguru.com/forum/showpo...96&postcount=3
    Rich

    A)bort, R)etry, I)nfluence with large hammer.
    Please take a moment to rate useful posts.

  7. #7
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: Game

    I do have a decent tile engine within the Massive DX8 2D Tutorial in my sig in case you wanna take a peek.

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