vooga.examples.event.demo2
Class Demo2

java.lang.Object
  extended by vooga.examples.event.demo2.Demo2

public class Demo2
extends java.lang.Object

This demo Demo2 shows how to use EventPool and IEventHandler to create events in game.

Taking ZombieLand game for example,Strong zombies, enemies of weak human, are trying to catch human in one line and end the game. The speed of the zombie is faster than human. Here is the fire event condition: when the zombie catches up with human which indicated by their x position, the human will be killed the killevent will be triggered. In this case, we can write a event class such as HumanKilledbyZombieEvent.Add it in the EventLoop class. And the eventLoop will check the event for you.


Constructor Summary
Demo2()
           
 
Method Summary
 void gameLoop()
           
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Demo2

public Demo2()
Method Detail

gameLoop

public void gameLoop()

main

public static void main(java.lang.String[] args)