scg/ch08/IteratedRectangleSprites

From FANG

Jump to: navigation, search

01 package scg.ch08;
02 
03 import fang2.core.Game;
04 import fang2.sprites.RectangleSprite;
05 
06 /**
07  * Iteration demonstration
08  */
09 public class IteratedRectangleSprites
10   extends Game {
11   /**
12    * 10 randomly colored and placed rectangles on the screen
13    */
14   @Override
15   public void setup() {
16     for (int = 0; i != 10++i{
17       RectangleSprite curr = new RectangleSprite(0.10.1);
18       curr.setLocation(randomDouble(), randomDouble());
19       curr.setColor(randomColor());
20       addSprite(curr);
21     }
22   }
23 }
24 
25 //Uploaded on Mon Mar 29 21:39:54 EDT 2010


Download/View scg/ch08/IteratedRectangleSprites.java





Views
Personal tools
Add to 
del.icio.usAdd to 
diggAdd to 
FacebookAdd to 
favoritesAdd to 
GoogleAdd to 
MySpaceAdd to 
PrintAdd to 
SlashdotAdd to 
StumbleUponAdd to 
Twitter

Games
Games