Class Nelzan
[ Source
| Index
| Back To Nelzan ]
- public class Nelzan
- extends Applet
- implements Runnable
Nelzan - A Space Arcade Game.
This Class handles state control, thread control, user input and
game level logic.
-
level
- Variable hold what level the player is currently on
-
pause
- Use To Tell if the Game is pasued or not.
-
Nelzan()
-
-
init()
- Starts that Applets execution
-
keyDown(Event, int)
- Handles Events when Keys are pressed.
-
keyUp(Event, int)
- Handles Events when Keys are let go.
-
mouseEnter(Event, int, int)
- Checks to see when the mouse enters the Applet window.
-
mouseExit(Event, int, int)
- Checks to see when the mouse leaves the Applet window.
-
paint(Graphics)
- This fuction paints everything for the user to See.
-
run()
- Handles Thread execution.
-
start()
- Starts Thread execution
-
stop()
- Stops thread execution.
-
update(Graphics)
- Override of update to prevent clearing of screen.
pause
public boolean pause
- Use To Tell if the Game is pasued or not.
level
public int level
- Variable hold what level the player is currently on
Nelzan
public Nelzan()
init
public void init()
- Starts that Applets execution
- Overrides:
- init in class Applet
start
public void start()
- Starts Thread execution
- Overrides:
- start in class Applet
stop
public void stop()
- Stops thread execution.
- Overrides:
- stop in class Applet
mouseEnter
public boolean mouseEnter(Event evt,
int x,
int y)
- Checks to see when the mouse enters the Applet window. When it does,
the game is unpasued automatically.
- Parameters:
- evt - the mouse event
- x - x location mouse entered
- y - y location mouse entered
- Returns:
-
false always
- Overrides:
- mouseEnter in class Component
mouseExit
public boolean mouseExit(Event evt,
int x,
int y)
- Checks to see when the mouse leaves the Applet window. When it does
the game is paused automatically.
- Parameters:
- evt - the mouse event
- x - x location mouse entered
- y - y location mouse entered
- Returns:
-
false always
- Overrides:
- mouseExit in class Component
keyDown
public boolean keyDown(Event evt,
int key)
- Handles Events when Keys are pressed. All KeyEvents are handled by this function,
to provide gameplay most like and arcade game tags inside of Player are
changed to true on keyDown.
- Parameters:
- evt - The Event ID
- key - The Key Pressed
- Returns:
-
false if state is not handling user Input
true otherwise
- Overrides:
- keyDown in class Component
- See Also:
- setMoveTrue
keyUp
public boolean keyUp(Event evt,
int key)
- Handles Events when Keys are let go. All KeyEvents are canceled by this
function, to provide gameplay most like an Arcade game tags inside of
Player are changed to false on keyUp.
- Parameters:
- evt - The Event ID
- key - The Key Pressed
- Returns:
-
true always.
- Overrides:
- keyUp in class Component
run
public void run()
- Handles Thread execution. If game is not paused both gameLogic() and
repaint() is called, otherwise just repaint() is called.
paint
public synchronized void paint(Graphics g)
- This fuction paints everything for the user to See. Depending on the
state, different fuctions are called from different classes.
- LOADSYSTEM - GAMEINST calls drawState(offscreenG);
- LEVELIMAGE - LEVELDELAY calls drawLevelState(offscreenG);
- LEVELPLAY calls ms.paint(offscreenG), me.paint(offscreenG),
enemy.paint(offscreenG), and paintPannel(offscreenG);
- Parameters:
- g - Where to paint to;
- Overrides:
- paint in class Container
update
public void update(Graphics g)
- Override of update to prevent clearing of screen.
- Overrides:
- update in class Container
|