2 Intended Operation of the Alerts Subsystem
Zac Adam-MacEwen edited this page 2022-01-12 13:57:28 -04:00

PETI is equipped with three mechanisms, each of which could play a role in alerting the user to an event which would warrant an alert:

  1. The LCD Display Itself;
  2. A blue "ALERT" LED located on the bottom left corner of the Development Kit's Rear Expansion Board (REB), and;
  3. A frequency-regulated piezo buzzer located centrally to the same component.

In general each of these alert avenues can be used in different ways:

  1. The LCD could be used to display an appropriate animation during an alert condition (via a modification to scenes/main_game.c);
  2. The Blue LED can be blinked or placed into a steadily-on state if there is an alert registered, and the device has not been interacted with, and;
  3. The Piezo buzzer can play notes of arbitrarily-different length (though they would all be locked to the same base frequency).

General Workflow

A function included in main.c (though ideally defined elsewhere) would be called once per main game loop, immediately after updating the game state, to determine if an alert is necessary and trigger it as appropriate.

Anticipated Alert Types:

  • Pending Evolution
  • Hunger or Food Alert
  • "Errant" Alert (Low Discipline)
  • Illness and Soiling Alert

Anticipated Handling of Various Alert Types

Pending Evolution

Pending an evolution, the pet should register an alert by playing a distinctive tune and rapidly blinking the LED. The evolution scene should then immediately be played which may contain other audio queues.

Hunger and Food Alerts (along with Errant Alerts)

An animation should be displayed on the screen similar to the eating animation, with additional icons displayed indicating the character is shouting. The Alert LED should be solidly lit thereafter until the next time the pet is interacted with.

Illness and Soiling Alerts

An animation should be displayed on the screen at the time of the alert showing the pet either becoming ill or soiling the play area; thereafter the appropriate iconography should appear on the main game screen to distinguish the two. A blinked alert LED should begin as soon as the pet becomes ill or soiled and remain until the illness and soiling has been resolved.

Note Bene: The alert code written for the sound device will likely be used as the general purpose sound driver for other applications. Note Bene 2: This is a reference discription only and will be updated when the final implementation is written.