Connect four game help
Author |
Message |
cube
|
Posted: Mon Oct 24, 2005 8:08 am Post subject: Connect four game help |
|
|
Okay so ive been working on a connect four game for quite some time now. Right now i have a 2D array where the game pieces are X's and O's and it will calculate a winner for verticle, horizontal and diagonal.
the problem is the user interface is terrible and i am new to programming and have no idea how to make it better or how to insert graphics. i would like to replace the printed text array with a connect four grid picture, but i have no clue how to replace the array with a picture and to substitute X & Y coordinents of the picture to the array.
where do i even start?
the attachments are the game an a C4 grid picture
ANY help or guidance is much appreciated, thankyou very much.
Description: |
|
Filesize: |
111.35 KB |
Viewed: |
4919 Time(s) |

|
Description: |
|
 Download |
Filename: |
connect four[1].t |
Filesize: |
1.93 KB |
Downloaded: |
241 Time(s) |
|
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
Tony

|
Posted: Mon Oct 24, 2005 8:48 am Post subject: (No subject) |
|
|
you're almost there.
You see how you use
Well your row / col are your x / y coordinates. The value there (X, O, +) is what picture you have to draw.
I suggest you have 3 images, each the size of a single cell. One is empty, and 2 are X/O images. Then you just loop through your chart by row and column, check what's in that cell, and Pic.Draw(picID, x, y)
Keep in mind that if each of your cells is say 20pixels, then your 1st column is at 0, 2nd at 20, 3rd at 40. You'd need to do some math to align the images.
|
|
|
|
|
 |
|
|