Dependencies:
N5110
mbed
PowerControl
« Back to documentation index
main.cpp File Reference
Source file for main game containing function defintions and main loop.
More...
Go to the source code of this file.
Detailed Description
Source file for main game containing function defintions and main loop.
Thomas Davies
Date: May 2015
Definition in file main.cpp .
Function Documentation
void advancePlatforms
(
int
n = 1 )
Advance Platforms.
animate platforms shift up n pixels
Parameters:
n - number of pixels to shift
Definition at line 131 of file main.cpp .
PWM speaker control function.
makes a boop sound used for collisions with platforms.
Definition at line 495 of file main.cpp .
ISR - Clock Counter.
increments number of clock cycles
Definition at line 266 of file main.cpp .
void endScreenController
(
)
Game Over Controller.
Displays end game screen, and allows user interaction with options via joystick. Also controls option selection and next screens.
Definition at line 273 of file main.cpp .
void highScoreEditor
(
char *
playerInitials ,
bool
isRecord
)
bool isBallDirClear
(
int
dir )
Is Ball Direction Clear?
given ball direction determines if path is clear to move.
Parameters:
dir - direction ball is travelling in (0 for left 1 for right)
Returns: 1 if clear 0 if not
Definition at line 178 of file main.cpp .
bool isBallFalling
(
int
bY )
Check if ball falling.
Falling if bal is in free space, not on platform
Parameters:
Returns: 1 if falling 0 if not.
Definition at line 153 of file main.cpp .
Is Joystick Down?
reads joystickY value and checks direction
Returns: 1 if down 0 if not.
Definition at line 251 of file main.cpp .
Is Joystick Left?
reads joystickX value and check direction
Returns: 1 if left 0 if not.
Definition at line 221 of file main.cpp .
is Record?
check if score achieved by player is a record
Returns: 1 if gameLevel is a record 0 if not
Definition at line 470 of file main.cpp .
Is Joystick Right?
reads joystickX value and check direction
Returns: 1 if right 0 if not.
Definition at line 206 of file main.cpp .
Is Joystick Up?
reads joystickY value and check direction
Returns: 1 if up 0 if not.
Definition at line 236 of file main.cpp .
void pauseScreenController
(
)
Pause Screen Controller.
Displays pause screen and allows user interaction to toggle sound,restart, and resume game.
Definition at line 515 of file main.cpp .
Power Saving Mode.
Powers down unused peripherals & ethernet
Definition at line 571 of file main.cpp .
Boop Helper function.
sets pin low when called, then starts timer to recall Boop();
Definition at line 503 of file main.cpp .
char* recordEntryController
(
)
Record Entry Controller.
Displays initial entry screen, allows user to scroll through letters and select initials.
Returns: intitials entered by user.
Definition at line 345 of file main.cpp .