Show an oval moving up til a value in an array?

Thread Solved

Join Date: Nov 2007
Posts: 28
Reputation: Cleo123 is an unknown quantity at this point 
Solved Threads: 0
Cleo123 Cleo123 is offline Offline
Light Poster

Show an oval moving up til a value in an array?

 
0
  #1
Mar 21st, 2008
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:

  1.  
  2. while(fallingCounter == true && x[j][i] < playerTurn)
  3. {
  4. //Move the counter vertically down the grid's rows appearing to fall
  5.  
  6. fallingCounter();
  7. g.setColor(counterColour);
  8. //counterWidth = counterWidth - 10;
  9. topYPos = topYPos + 10;
  10. //centeredCounterInColumn = centeredCounterInColumn +10;
  11. g.fillOval(centeredCounterInColumn,topYPos, counterWidth, counterHeight);
  12.  
  13. }

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.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC