As cervantes mentioned check out the second link he posted. 2d arryas are great for makiong a layout of a checkerboard!!!!
person
Posted: Tue Jan 25, 2005 5:29 pm Post subject: (No subject)
u can learn arrays but if u really dont get it, u can just use lots of variables. but seriously.. arrays will save u a ton of time, so use arrays!
Naveg
Posted: Tue Jan 25, 2005 6:33 pm Post subject: (No subject)
ok let me rephrase my question. The board and pieces are drawn using for loops and if statements. It works. The question is, will it be possible to have the pieces move and stuff with the setup like this, or are arrays a MUST?
cycro1234
Posted: Tue Jan 25, 2005 7:40 pm Post subject: (No subject)
Well, u might have to use arrays when checking for things such as jumping over an enemy, or kinging someone. To move the pieces, u cud try using the mouse command "mouswhere" and have the pice follow the mouse. But then u'd have to make boundries so the user can't put the pieces anywhere he/she wants....
I love checkers! Good luck wit it, nd if its not a final project or sometin, PM me nd i'll help as best as i can.
Sponsor Sponsor
person
Posted: Tue Jan 25, 2005 8:18 pm Post subject: (No subject)
now, if u dont like arrays for some odd reason, or u dont like mousewhere, u can always select a piece, and then using the arrow key to move it
person
Posted: Tue Jan 25, 2005 8:20 pm Post subject: (No subject)
btw, y dont u want to use arrays
Naveg
Posted: Tue Jan 25, 2005 8:39 pm Post subject: (No subject)
cause i dont know how to use em to draw a board, and how to apply them to identify each piece....the tutorials didnt help me so much
basketball4ever
Posted: Wed Jan 26, 2005 1:10 am Post subject: (No subject)
it IS possible, but your looking at around 1000-2000 lines just from the board, and not even the processing of each card (money/go to jail)
you just have to set a coordinate as position for each player... so that the position = position + dice roll
then u just set the coordinates for each position for example: (there should be 36 different positions for monopoly i believe) so position 1 (start) would be like (0,500) then position 2 (50,500) and so on...
strongly dont recomend it cos it takes alot of lines and trouble... but meh if you want it this way its easier with arrays definetly
Trojan Man
Posted: Wed Jan 26, 2005 3:28 am Post subject: (No subject)
You'll be able to move the pieces without using arrays without much problem, but then when it comes to the rules of the game, that's gonna be a pain in the ass.
Quote:
it IS possible, but your looking at around 1000-2000 lines just from the board, and not even the processing of each card (money/go to jail)
you just have to set a coordinate as position for each player... so that the position = position + dice roll
then u just set the coordinates for each position for example: (there should be 36 different positions for monopoly i believe) so position 1 (start) would be like (0,500) then position 2 (50,500) and so on...
strongly dont recomend it cos it takes alot of lines and trouble... but meh if you want it this way its easier with arrays definetly
Umm, not to be mean or anything, but I think this topic is about checkers, not monopoly...
basketball4ever
Posted: Wed Jan 26, 2005 2:06 pm Post subject: (No subject)
Trojan Man wrote:
You'll be able to move the pieces without using arrays without much problem, but then when it comes to the rules of the game, that's gonna be a pain in the ass.
Quote:
it IS possible, but your looking at around 1000-2000 lines just from the board, and not even the processing of each card (money/go to jail)
you just have to set a coordinate as position for each player... so that the position = position + dice roll
then u just set the coordinates for each position for example: (there should be 36 different positions for monopoly i believe) so position 1 (start) would be like (0,500) then position 2 (50,500) and so on...
strongly dont recomend it cos it takes alot of lines and trouble... but meh if you want it this way its easier with arrays definetly
Umm, not to be mean or anything, but I think this topic is about checkers, not monopoly...
Quote:
for example
make him think for himself
cycro1234
Posted: Wed Jan 26, 2005 3:43 pm Post subject: (No subject)
Just as used 2 for loops to create the gameboard, you can use an array to create empty variables for each space. That is, assign each variable a value of "0" if there is no piece, "1" if theres a player 1 piece, and "2" if there's a player 2 piece. Then, u can check to see position of the pieces using if statements.