Results 1 to 7 of 7

Thread: How would i go about making a column's clone?

  1. #1

    Thread Starter
    Fanatic Member Redth's Avatar
    Join Date
    May 2001
    Location
    Ontario, Canada
    Posts
    551

    How would i go about making a column's clone?

    hello

    i think the time has come where i would finally like to learn how to make some kinda of game..... something simple.. like an arcade game..... pong, whatever...

    i just need some help to get into the right mindset, and get some ideas about how certain things are usually done in the gaming world

    right now, my objective is to make a game called columns...
    i attatched the original game... it's a small but very amusing game ...

    i made one attempt, just using shape controls (used 6 shapes in control arrays .... each shape array was a column... and there were about 18 indexes in each column......

    i had them colored vbwhite... then, i was using some random numbers to generate new sets of 3 blocks that would be random colors... this works great... then, everytime the timer went off i would go through some logic....

    check to see if it was at the bottom, if not, move blocks down (really just changing the next block's color, and changing the trailing block back to white.....

    this worked..
    until i tryed checking to see if the block ahead was white, or if it was cleared.... well i ran into some problems, and im thinking that the way im trying to do this isn't the most efficient or feasible.....

    so, could some of you gaming guru's check out the columns game attatched to this post (if you haven't already played it ) and suggest to me how one might go about making something like this?

    i just really want the main concepts. (but i probly will be back later asking for help when something goes wrong)...


    any tutorials or things like that would be helpful as well.....

    i appreciate your time

  2. #2
    Zaei
    Guest
    Ok, here is the way i would do it.

    First, create a 2D array for the grid spaces. Something like 25x10. Next, create a type:
    Code:
    Type Column
        X as long 'x position in array
        Y as long 'y   "           "    "
        F as byte 'first color in column, top down
        S as byte 'second color in column...
        T as byte 'third ....
    End Type
    Now, while the game is running, if there is not a column in play, fill in the values in a single Column variable (only use one, youll see why later). Y values should go from the top down (like the screen). Now, for each game tick(each update), drop the block by one y value, check user input, and move the block accordingly, etc. Check the grid to see if Grid(Col.X)(Col.Y+2) <> 0. If so, there is already a block there, stop moving that block. In the grid, fill in the values:
    Code:
    Grid(Col.X)(Col.Y) = Col.F
    Grid(Col.X)(Col.Y+1) = Col.S
    Grid(Col.X)(Col.Y+2) = Col.T
    Then, you can check the values in the array for groups of three or more in a row (you can do that). Then, if there are any, shift all blocks above the one that should be removed down 1, and fill in with a 0 at the top, and repeat the process.

    Z.

  3. #3
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    You could write some logic for it:
    VB Code:
    1. Function CheckColumns(NumColumns As Byte, NumRows As Byte)
    2. Dim I As Byte
    3. Dim J As Byte
    4.  
    5.    For I = 0 To NumColumns
    6.       For J = 0 To NumRows
    7.          'check here
    8.       Next J
    9.    Next I
    10.  
    11. End Function
    And then, you could have another function that would shift all of them down, etc.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  4. #4
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    And also in VB, arrays are called this way: Array(multidimensional,grids,are,cool)
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  5. #5
    Zaei
    Guest
    .... Oh yeah... -.-;; Learn C++ =P.

    Z.

  6. #6

    Thread Starter
    Fanatic Member Redth's Avatar
    Join Date
    May 2001
    Location
    Ontario, Canada
    Posts
    551
    First, create a 2D array for the grid spaces. Something like 25x10. Next, create a type:
    heh sorry to be dense, but what control would u use for this 2d array of grid spaces?

    :P

    ty for all the response too! im gonna try and start this tonight

  7. #7
    Zaei
    Guest
    No control. Just a standard 2d array:
    Code:
    Dim Grid(25, 10) as Long
    Z.

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