scg/ch08/IterateSquares

From FANG

Jump to: navigation, search

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


Download/View scg/ch08/IterateSquares.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