Arrivo Golf - Use Cases
Use Cases
Scope: Game
Initiator: Player
Actors: Main Game Loop, Physics Engine, Graphics Engine, Listeners,
Collision detection
- Game starts up
- Main Game Loop initializes Graphics Engine
- Graphics Engine draws initial viewpoint
- Main Game Loop sets up Listeners
While Strokes > 0 and Player hasn't won:
- Game Loop Listen for player input
- Player swings golf club
- Physics Engine launches golf ball
- Graphics Engine animates ball trajectory
- 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
- Physics engine calculates forces acting on the ball
- Physics engine sums forces and calculates acceleration
- Physics engine uses acceleration to calculate new velocity
- Physics engine uses velocity to calculate new position
- Collision detection
- Graphics engine determines new position for camera
- Graphics engine takes locations of camera and golf ball and draws the
scene
- 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