| | |
Show an oval moving up til a value in an array?
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Nov 2007
Posts: 28
Reputation:
Solved Threads: 0
This is a connect four game and I'm trying to show the counter falling. What I have so far is this which is in a for loop:
This and similar versions of this, in and outside the for loop and in a do loop have shown the counter rapidly falling continuously showing previous ovals drawn (so it shows the whole falling path like a long rounded line going downwards). It only stops when I say until < grid[0].length in the while/for but I'm still left with the former problem and I want the "animation" to stop before a counter in the column - not just go over already inserted counters in the column till it reaches the bottom. I've been trying this for at least 5 hours now so I really would appreciate help with this one. I really would like to do this.
Java Syntax (Toggle Plain Text)
while(fallingCounter == true && x[j][i] < playerTurn) { //Move the counter vertically down the grid's rows appearing to fall fallingCounter(); g.setColor(counterColour); //counterWidth = counterWidth - 10; topYPos = topYPos + 10; //centeredCounterInColumn = centeredCounterInColumn +10; g.fillOval(centeredCounterInColumn,topYPos, counterWidth, counterHeight); }
This and similar versions of this, in and outside the for loop and in a do loop have shown the counter rapidly falling continuously showing previous ovals drawn (so it shows the whole falling path like a long rounded line going downwards). It only stops when I say until < grid[0].length in the while/for but I'm still left with the former problem and I want the "animation" to stop before a counter in the column - not just go over already inserted counters in the column till it reaches the bottom. I've been trying this for at least 5 hours now so I really would appreciate help with this one. I really would like to do this.
![]() |
Other Threads in the Java Forum
- Previous Thread: Image Icon displays file name text
- Next Thread: In desperate need of help with iterative insert method for avl tree. please help
Views: 499 | Replies: 0
| Thread Tools | Search this Thread |
Tag cloud for Java
-xlint android animated api apple applet application arguments array arrays automation binary blackberry block bluetooth chat class classes client code component database developmenthelp draw eclipse encode error event exception file fractal game gameprogramming givemetehcodez graphics gui helpwithhomework html ide image input integer iphone j2me j2seprojects java javac javaprojects jmf jni jpanel julia lego linux list loop loops mac map method methods mobile netbeans newbie notdisplaying number object online oracle print problem program programming project recursion scanner screen server set singleton size sms socket sort sql string swing system template test textfields threads time title transfer tree tutorial-sample update windows working





