Game Engine Events

Introductions

Introduce yourselves!

Icebreaker: What’s your favorite Mobile game?


Groupwork

Games are inherently event-driven.

An event is anything that happens that a game object may need to take note of.

  1. What are some examples of game engine events?

  2. Generally, a game engine must: A) Notify interested game objects, and B) Arrange for those game objects to respond. This is called event handling.

    void Explosion::Update()
     ...
      if (explosion_went_off) then

        // Get list of all Objects in range.
        ObjectList list = WM.getObjectsInRange(radius)

        // Have each object react to explosion.
        ObjectListIterator i(&list)
        for (i.first(); !i.isDone(); i.next())
          
          i.currentObject() -> onExplosion()

        end for
        ...

      end if
  1. What’s the problem with using the binding in #2 for a general purpose game engine?

Hand-in

Submit your answers:

https://wpi.qualtrics.com/jfe/form/SV_2ovpcEWigwwI32K

Make sure to include the names of all group members.

Happy event-ing!

– Mark