scg/ch03/Ovals

From FANG

Jump to: navigation, search

01 package scg.ch03;
02 
03 import fang2.core.Game;
04 import fang2.sprites.OvalSprite;
05 
06 /** Draws two eyes and uses two overlapping ovals to draw a mouth. */
07 public class Ovals
08   extends Game {
09   /**
10    * Draw four ovals; one in background color
11    */
12   @Override
13   public void setup() {
14     OvalSprite white = new OvalSprite(0.70.2);
15     white.setColor(getColor("white"));
16     white.setLocation(0.50.5);
17     addSprite(white);
18 
19     OvalSprite black = new OvalSprite(0.70.2);
20     black.setColor(getColor("black"));
21     black.setLocation(0.50.4);
22     addSprite(black);
23 
24     OvalSprite left = new OvalSprite(0.20.2);
25     left.setColor(getColor("white"));
26     left.setLocation(0.250.25);
27     addSprite(left);
28 
29     OvalSprite right = new OvalSprite(0.20.2);
30     right.setColor(getColor("white"));
31     right.setLocation(0.750.25);
32     addSprite(right);
33   }
34 }
35 
36 //Uploaded on Mon Mar 29 21:40:16 EDT 2010


Download/View scg/ch03/Ovals.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