Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
Taking Turns in A Dice Game Question
Author Message
Paul

Posted: Fri Mar 19, 2004 8:54 pm   Post subject: (No subject)

Hm, I thought you could only move airplanes that are already in flight mode.
oh yea, how do you plan to move the pieces kukrichan?

KukuriChan

Posted: Sat Mar 20, 2004 12:18 am   Post subject: (No subject)

Thanks SuperGenius. ^^

Paul: I'm planning on using arrays to move the pawns. See, I already have all the x and y coordinates for each circle so I was thinking that if I add the number that the player rolled onto the original number in that particular array, it can just draw everything and then the pawn will appear whatever the position in the array will be. But... I don't know if that'll really work yet since I haven't tried. ^^;; I'm hoping that'll work. But I have to remember that once they move the airplane, it'll have it's own path to take. So, that means, I have to make four different arrays for the path of each colour right?
SuperGenius

Posted: Sun Mar 21, 2004 4:54 pm   Post subject: (No subject)

Your problem of drawing the pieces is kind of like what i did for my connect 4 game, except more complicated. I had a 2d array that held coords. and then this structure to draw the circles, with a little 'formula' that would convert the coords on the board to pixel coords on the screen.

 code: proc drawboard     for h : 1 .. 8         for c : 1 .. 8             if board (h, c) not= " " then                 if board (h, c) = "RED" then                     Draw.FillOval (130 + c * 60, 80 + h * 60, 25, 25, red)                 elsif board (h, c) = "GREEN" then                     Draw.FillOval (130 + c * 60, 80 + h * 60, 25, 25, green)                 end if             end if         end for     end for end drawboard

perhaps the same concept would work for your project?
KukuriChan

Posted: Sun Mar 21, 2004 8:15 pm   Post subject: (No subject)

Oh, I have the board drawn out already. I used PhotoPaint to do that. I just have to figure out a way of using arrays to move the pieces and then redraw all the pieces. That part is giving me a headache.

chess-game-carpet600.jpg
Description:
Filesize:  69.98 KB
Viewed:  1308 Time(s)

chess-game-carpet600.jpg
Description:
 The Game Board for Flight.
Filesize:  69.98 KB
Viewed:  1308 Time(s)

SuperGenius

Posted: Tue Mar 23, 2004 10:55 pm   Post subject: (No subject)

What i was suggesting was a method to update the screen after each move. As for updating the arrays, i dont know. The fact that the path turns and twists presents a bit of a challenge. Perhaps you could have a loop that would move the piece one square forward at a time, with the direction that it's moving in as a variable that would be changed when the piece rests on a corner space.
Paul

Posted: Wed Mar 24, 2004 2:19 pm   Post subject: (No subject)

Wow, thats difficult. But as a suggestion, if I were doing this program I would either map out the whole thing with a 2D array or something, or I'd draw the whole board again, from a text file, somethink like isometrics. Then you can set rules that it can only move in one direction. Also check to win or something, just my opinion.
KukuriChan

Posted: Wed Mar 24, 2004 10:46 pm   Post subject: (No subject)

Hey thanks for your suggestions/advice you guys. I ended up doing it with a two dimensional array. Now the only thing I have to do is to get it to work when it comes to move the pawns on the actual path when you get the value you roll from the die. I have to do the checking stuff too. But I don't think that'll be that hard after I get the pawns moving.

^^
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 2 of 2  [ 22 Posts ]
Goto page Previous  1, 2
 Jump to:  Select a forum  CompSci.ca ------------ - Network News - General Discussion     General Forums   -----------------   - Hello World   - Featured Poll   - Contests     Contest Forums   -----------------   - DWITE   - [FP] Contest 2006/2008   - [FP] 2005/2006 Archive   - [FP] 2004/2005 Archive   - Off Topic     Lounges   ---------   - User Lounge   - VIP Lounge     Programming -------------- - General Programming     General Programming Forums   --------------------------------   - Functional Programming   - Logical Programming   - C     C   --   - C Help   - C Tutorials   - C Submissions   - C++     C++   ----   - C++ Help   - C++ Tutorials   - C++ Submissions   - Java     Java   -----   - Java Help   - Java Tutorials   - Java Submissions   - Ruby     Ruby   -----   - Ruby Help   - Ruby Tutorials   - Ruby Submissions   - Turing     Turing   --------   - Turing Help   - Turing Tutorials   - Turing Submissions   - PHP     PHP   ----   - PHP Help   - PHP Tutorials   - PHP Submissions   - Python     Python   --------   - Python Help   - Python Tutorials   - Python Submissions   - Visual Basic and Other Basics     VB   ---   - Visual Basic Help   - Visual Basic Tutorials   - Visual Basic Submissions     Education ----------- - Student Life   Graphics and Design ----------------------- - Web Design     Web Design Forums   ---------------------   - (X)HTML Help   - (X)HTML Tutorials   - Flash MX Help   - Flash MX Tutorials   - Graphics     Graphics Forums   ------------------   - Photoshop Tutorials   - The Showroom   - 2D Graphics   - 3D Graphics     Teams ------ - dTeam Public

 Style: Appalachia blueSilver eMJay subAppalachia subBlue subCanvas subEmjay subGrey subSilver subVereor Search: