scg/ch04/NewtonsAppleSprites

From FANG

Jump to: navigation, search

01 package scg.ch04;
02 
03 import fang2.core.Game;
04 import fang2.sprites.OvalSprite;
05 import fang2.sprites.RectangleSprite;
06 import fang2.sprites.StringSprite;
07 
08 /** NewtonsApple pre-prototype */
09 public class NewtonsAppleSprites
10   extends Game {
11   // An OvalSprite field to name the apple
12   private OvalSprite apple;
13   // A RectangleSprite field to name newton
14   private RectangleSprite newton;
15 
16   // First pass at defining the sprites for the game
17   @Override
18   public void setup() {
19     apple = new OvalSprite(0.100.10);
20     apple.setColor(getColor("red"));
21     apple.setLocation(0.500.00);
22 
23     newton = new RectangleSprite(0.100.10);
24     newton.setColor(getColor("green"));
25     newton.setLocation(0.500.90);
26 
27     addSprite(newton);
28     addSprite(apple);
29   }
30 }
31 
32 //Uploaded on Mon Mar 29 21:41:50 EDT 2010


Download/View scg/ch04/NewtonsAppleSprites.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