VHagen/ValHagensArcadeLauncher

From ggc

Jump to: navigation, search

01 package VHagen;
02 import java.awt.Color;
03 import java.awt.event.KeyEvent;
04 import arcade.*;
05 import fang.*;
06 
07 /**
08  * This class simply launches the ArcadeGame.
09  @author Valerie Hagen  
10  *  I looked at Dr. Jam Jenkins ClassArcade code for help making my arcade.
11  */
12 public class ValHagensArcadeLauncher extends GameLoop
13 {
14   private ArcadeGame topLevel;
15   private Sprite title;
16 
17   /**
18    * sets the level at which to start
19    */
20   public void startGame()
21   {
22 
23 
24     topLevel=new ValHagensArcade();
25     topLevel.setName("Val Hagen's Arcade!");
26     setNextLevel(topLevel);
27 
28     title=new StringSprite("Click titles to play! Have fun! Thanks for playing!");
29     title.setLocation(0.5,0.5);
30     title.setScale(0.8);
31     title.setColor(Color.WHITE);
32     canvas.addSprite(title);
33 
34     StringSprite toFinish=new StringSprite("Press ESC\nto end game");
35     toFinish.rightJustify();
36     toFinish.bottomJustify();
37     toFinish.setScale(0.2);
38     toFinish.setLocation(0.980.98);
39     toFinish.setColor(new Color(255255064));
40     canvas.addSprite(toFinish);
41     topLevel.persist(toFinish);
42   }
43 
44   /**
45    * enables the Escape key to finish the level at any time
46    */
47   public void advanceFrame(double timeElapsed)
48   {
49     if(getPlayer().getKeyboard().getLastKey()==KeyEvent.VK_ESCAPE)
50       finishLevel();
51     if(getLevelNumber()==0)
52       setNextLevel(topLevel);
53   }
54 
55   /**
56    * runs the game as an application
57    @param args not used
58    */
59   public static void main(String[] args)
60   {
61     new ArcadeLauncher().runAsApplication();
62   }
63 }

Compiler Errors:
----------
1. ERROR in VHagen/ValHagensArcade.java (at line 15)
	addArcadeLevel(new Val.LetsMakeADealLevel());
	                   ^^^^^^^^^^^^^^^^^^^^^^
Val.LetsMakeADealLevel cannot be resolved to a type
----------
----------
2. ERROR in Valerie/Wackadot/WackadotLevel.java (at line 54)
	dot=new ImageSprite(Wiki.getMedia("Dog.gif"));
The constructor ImageSprite(URL) is undefined
----------
22 problems (22 errors)

Download/View VHagen/ValHagensArcadeLauncher.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