Tarek Bessalah 201344887

Dependencies:   mbed

Objective The objective of the game is to reach the end goals located at the top of the screen, as well as avoiding the snakes, vehicles, turtles when they are underground, and the water. As the levels progress, things get harder! So You need to avoid enemy objects. Make sure to get on logs when you want to cross the water.

Intro Screen

Play - You need to pass Level 1 in order to progress to the following level Tutorial- This informs you how to play the game Bonus - This is a bonus level, this is a very challenging so play with precautions! You cannot hit the objects, and go into the void background frogger_logo_owner.png 404 x 152 px 14.0 KB May 27, 2020 1 Item Image: 1 Document: 0

To control the menu use the X button to go up, and the B button to go down. Use A to select. To skip through the tutorial pages, use A. At the endhttps://os.mbed.com/media/uploads/el19tb/frogger_logo_owner.png of the tutorial you will play the game.

Controls

Use A, X, B, Y to move right, Up, Down, and Left respectively, this controls the frog object

Committer:
el19tb
Date:
Wed May 27 01:54:46 2020 +0000
Revision:
61:3714af9caab6
Parent:
56:2797166656e0
Final Submission. I have read and agreed with Statement of Academic Integrity.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
eencae 0:b7f1f47bb26a 1 /*
el19tb 55:b17b9931c010 2 * ELEC2645 Embedded Systems Project
el19tb 55:b17b9931c010 3 * School of Electronic & Electrical Engineering
el19tb 55:b17b9931c010 4 * University of Leeds
el19tb 55:b17b9931c010 5 * 2019/20
el19tb 55:b17b9931c010 6 *
el19tb 55:b17b9931c010 7 * Name: Tarek Bessalah
el19tb 55:b17b9931c010 8 * Username: el19tb
el19tb 55:b17b9931c010 9 * Student ID Number: 201344887
el19tb 55:b17b9931c010 10 * Date: May, 2020
el19tb 55:b17b9931c010 11 */
eencae 0:b7f1f47bb26a 12
eencae 0:b7f1f47bb26a 13 #include "mbed.h"
eencae 0:b7f1f47bb26a 14 #include "Gamepad.h"
eencae 0:b7f1f47bb26a 15 #include "N5110.h"
el19tb 29:2151cd327a36 16 #include "Frogger.h"
el19tb 55:b17b9931c010 17 #include "Test.h"
el19tb 55:b17b9931c010 18
el19tb 55:b17b9931c010 19 void conduct_test();
eencae 0:b7f1f47bb26a 20
eencae 0:b7f1f47bb26a 21 int main()
eencae 0:b7f1f47bb26a 22 {
el19tb 37:65c9e5a65738 23 int size = 4; // game grid size
el19tb 44:f02510eeb165 24 int lcd_x = 84;
el19tb 44:f02510eeb165 25 int lcd_y = 48;
el19tb 39:8b09540724b3 26 int frog_width = 6; // width of frog, slightly fatter than width
el19tb 55:b17b9931c010 27
el19tb 55:b17b9931c010 28 //conduct_test(); // run the tests of the program
el19tb 55:b17b9931c010 29
el19tb 39:8b09540724b3 30 Frog frog((lcd_x/2)-frog_width/2, lcd_y-size, frog_width); // start at the bottom centre
el19tb 29:2151cd327a36 31 Frog *frogptr= &frog; // user will have control over this
eencae 0:b7f1f47bb26a 32
el19tb 55:b17b9931c010 33 //printf("FROG POSITION, x: %d, y: %d", frog->x, frog->y)
el19tb 55:b17b9931c010 34
el19tb 55:b17b9931c010 35 Frogger game(frogptr, size, lcd_x, lcd_y); // accepts the frogptr and graphics classes
el19tb 56:2797166656e0 36 game.displayIntro(); // display the intro screen on boot up
el19tb 29:2151cd327a36 37 game.start(); // start the game loop
eencae 0:b7f1f47bb26a 38 }
el19tb 55:b17b9931c010 39
el19tb 55:b17b9931c010 40 void conduct_test()
el19tb 55:b17b9931c010 41 {
el19tb 55:b17b9931c010 42 #ifdef LOGGER_MODE
el19tb 55:b17b9931c010 43 run_progression();
el19tb 55:b17b9931c010 44 run_collision_detection();
el19tb 55:b17b9931c010 45 run_row_func();
el19tb 55:b17b9931c010 46 run_rect_params();
el19tb 55:b17b9931c010 47 run_frog_test();
el19tb 55:b17b9931c010 48 #endif
el19tb 55:b17b9931c010 49 }