scg/ch03/LeftWing

From FANG

Jump to: navigation, search

01 package scg.ch03;
02 
03 import fang2.core.Game;
04 import fang2.sprites.OvalSprite;
05 
06 /** Draws an oval and a rotated copy of the oval. */
07 public class LeftWing
08   extends Game {
09   /**
10    * Setup the "game": create two wings, original and rotated. Outline
11    * original in white, rotated in black. Demonstrate rotation
12    * direction.
13    */
14   @Override
15   public void setup() {
16     // Let the bee fly on a grassy background.
17     setBackground(getColor("green"));
18 
19     OvalSprite originalWing = new OvalSprite(0.350.7);
20     originalWing.setColor(getColor("Wheat"128));
21     originalWing.setOutlineColor(getColor("white"));
22     originalWing.setOutlineThickness(0.01);
23     originalWing.showOutline();
24     originalWing.setLocation(0.360.6);
25     addSprite(originalWing);
26 
27     OvalSprite leftWing = new OvalSprite(0.350.7);
28     leftWing.setColor(getColor("Wheat"128));
29     leftWing.setOutlineColor(getColor("black"));
30     leftWing.setOutlineThickness(0.01);
31     leftWing.showOutline();
32     leftWing.rotateDegrees(+45.0);
33     leftWing.setLocation(0.360.6);
34     addSprite(leftWing);
35   }
36 }
37 
38 //Uploaded on Mon Mar 29 21:42:34 EDT 2010


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