Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Connect four game help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
cube




PostPosted: 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.



C4.jpg
 Description:
C4 picture/grid
 Filesize:  111.35 KB
 Viewed:  4378 Time(s)

C4.jpg



connect four[1].t
 Description:
C4 game

Download
 Filename:  connect four[1].t
 Filesize:  1.93 KB
 Downloaded:  229 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Mon Oct 24, 2005 8:48 am   Post subject: (No subject)

you're almost there.

You see how you use
code:
chart (row, col)

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.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: