Arrivo Golf - Use Cases

Use Cases

Scope: Game
Initiator: Player
Actors: Main Game Loop, Physics Engine, Graphics Engine, Listeners, Collision detection

  1. Game starts up
  2. Main Game Loop initializes Graphics Engine
  3. Graphics Engine draws initial viewpoint
  4. Main Game Loop sets up Listeners
  5. While Strokes > 0 and Player hasn't won:
  6. Game Loop Listen for player input
  7. Player swings golf club
  8. Physics Engine launches golf ball
  9. Graphics Engine animates ball trajectory
  10. Collision detection watches for collision condition

Extensions
5a. Player does not input, then restart main game loop
5b. Player changes viewport, then call graphics engine to redraw scene
5c. Player inputs in some other way, ...
9a. No collision detected, then restart main game loop
9b. Collision detected, then call physics engine to modify trajectory and call graphics engine to redraw.

Use case for the dt time step


Scope: all action while the golf ball is moving
Initiator: physics engine
Other actors: graphics engine

  1. Physics engine calculates forces acting on the ball
  2. Physics engine sums forces and calculates acceleration
  3. Physics engine uses acceleration to calculate new velocity
  4. Physics engine uses velocity to calculate new position
  5. Collision detection
  6. Graphics engine determines new position for camera
  7. Graphics engine takes locations of camera and golf ball and draws the scene
  8. If necessary, the game waits so as to not exceed the desired frame rate

Extensions
3a. If the ball is at rest (v=0), then break the time step loop and return to the main game loop
5a. If the golf ball enters the cup, the game ends
5b. If the golf ball collides with any other object, the forces need to be adjusted

George Kuan
Last modified: Wed Oct 30 19:16:51 PST 2002