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

Username:   Password: 
 RegisterRegister   
 Taking Turns in A Dice Game Question
Index -> Programming, Turing -> Turing Help
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Paul




PostPosted: 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?
Sponsor
Sponsor
Sponsor
sponsor
KukuriChan




PostPosted: 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? Smile
SuperGenius




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

your welcome.

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




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


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

chess-game-carpet600.jpg



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

chess-game-carpet600.jpg


SuperGenius




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




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




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

Page 2 of 2  [ 22 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: