Class com.next.gt.Gamelet
All Packages Class Hierarchy This Package Previous Next Index
Class com.next.gt.Gamelet
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----java.applet.Applet
|
+----com.next.gt.Gamelet
- public class Gamelet
- extends Applet
- implements Runnable
-
actorManager
-
-
currentTickTimeMillis
-
-
displayManager
-
-
eventManager
-
-
lastTickTimeMillis
-
-
runner
-
-
scoreManager
-
-
SLEEP_MILLIS
-
-
Gamelet()
-
-
deltaTickTimeMillis()
- Calculater the difference between the current tick and the last one.
-
getAppletInfo()
- Provide standard Gamelet info.
-
handleEvent(Event)
- Pass the event along to the EventManager for handling.
-
init()
- Initialize.
-
paint(Graphics)
- Pass the Graphics onto the DisplayManager.
-
randBetween(double, double)
- Generate a random double between two doubles.
-
run()
- Execution loop.
-
sleepMillis()
-
-
start()
- Start the thread.
-
stop()
- Stop the thread.
-
tick()
- Distribute tick to the ActorManager and update display.
-
update(Graphics)
- Override update to avoid screen clears.
runner
public Thread runner
currentTickTimeMillis
public long currentTickTimeMillis
lastTickTimeMillis
public long lastTickTimeMillis
actorManager
public ActorManager actorManager
displayManager
public DisplayManager displayManager
scoreManager
public ScoreManager scoreManager
eventManager
public EventManager eventManager
SLEEP_MILLIS
public int SLEEP_MILLIS
Gamelet
public Gamelet()
randBetween
public static double randBetween(double a,
double b)
- Generate a random double between two doubles.
init
public void init()
- Initialize.
- Overrides:
- init in class Applet
start
public void start()
- Start the thread.
- Overrides:
- start in class Applet
stop
public void stop()
- Stop the thread.
- Overrides:
- stop in class Applet
sleepMillis
public long sleepMillis()
run
public void run()
- Execution loop. Used to call tick().
tick
public void tick()
- Distribute tick to the ActorManager and update display.
handleEvent
public boolean handleEvent(Event theEvent)
- Pass the event along to the EventManager for handling.
- Overrides:
- handleEvent in class Component
deltaTickTimeMillis
public double deltaTickTimeMillis()
- Calculater the difference between the current tick and the last one.
update
public void update(Graphics g)
- Override update to avoid screen clears.
- Overrides:
- update in class Component
paint
public void paint(Graphics g)
- Pass the Graphics onto the DisplayManager.
- Overrides:
- paint in class Component
getAppletInfo
public String getAppletInfo()
- Provide standard Gamelet info.
- Overrides:
- getAppletInfo in class Applet
All Packages Class Hierarchy This Package Previous Next Index