100 likes | 230 Views
ECE 3551 Final Project: Simon Emulator. Danielle Roy. Objective. The goal of this project is to create an emulation of a popular children’s game. This game flashes a pattern at the player, and the player must recreate the pattern given a set of buttons. How the Game Works.
E N D
ECE 3551 Final Project: Simon Emulator Danielle Roy
Objective • The goal of this project is to create an emulation of a popular children’s game. This game flashes a pattern at the player, and the player must recreate the pattern given a set of buttons.
How the Game Works • The game consists of ten levels • Each level has a pattern length equal to the level number • The same pattern is used each level with one more light added to the sequence at each level up • The player must memorize the pattern and recreate it using the buttons • To win, a player must beat all ten levels • A player loses when an incorrect button is pressed
Game Construction • There are 5 files in the final project • Initialize.c • main.c • ISR.c • Process_Lights.c • Talkthrough.h • The final project used some initialization code from the Talkthrough folder used in Labs 3-5
Initialize.c • Initialize.c included two header files: Talkthrough.h and math.h • Talkthrough.h included all the functions and variables used in the project • math.h was included so that the rand() function could be called • Initialize.c initialized critical sections of the BF533 so that the LEDs and buttons would work • Initialize.c also included most of the defined functions for the program
main.c • main.c is the part of the code where the initialization functions are actually run • It is kept running infinitely until halted in order to ensure continuous play
ISR.c • The ISR.c file handles all the interrupts for the system. • Handles the specific instructions for pressed buttons • Begins the actual game • Calls the Process_Lights() function at the end to continue (or end) the game
Process_Lights.c • Contains most of the actual game code • Defines the Process_Lights() function, which displays the pattern and waits for user input • Has a light pattern for game won • Has a light pattern for game lost • Resets game after end
Talkthrough.h • Contains prototypes of all functions in the project • Contains external declarations of all variables • Defines Ports
Conclusion • Project was built successfully • Areas for improvement/expansion: • Add tones to play with the lit LEDs • Investigate a better seed for the rand() function • Currently using iChannel0LeftIn • Works but is predictably random