Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Frogger/Frogger.h@43:2cd1cfe07770, 2020-05-18 (annotated)
- Committer:
- el19tb
- Date:
- Mon May 18 06:34:53 2020 +0000
- Revision:
- 43:2cd1cfe07770
- Parent:
- 42:04e326dcf09b
- Child:
- 44:f02510eeb165
fixed bugs throughout program, fixed array size issue, fixed functions
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
el19tb | 29:2151cd327a36 | 1 | #ifndef FROGGER_H |
el19tb | 29:2151cd327a36 | 2 | #define FROGGER_H |
el19tb | 3:648c9d5001be | 3 | |
el19tb | 2:86cef2afa648 | 4 | #include "mbed.h" |
el19tb | 2:86cef2afa648 | 5 | #include "N5110.h" |
el19tb | 2:86cef2afa648 | 6 | #include "Gamepad.h" |
el19tb | 29:2151cd327a36 | 7 | #include "Frog.h" |
el19tb | 11:cc5861abfca5 | 8 | #include "Level.h" |
el19tb | 13:cd6d2f999057 | 9 | |
el19tb | 4:aae7f8d4ab78 | 10 | #include <vector> |
el19tb | 2:86cef2afa648 | 11 | |
el19tb | 29:2151cd327a36 | 12 | class Frogger |
el19tb | 29:2151cd327a36 | 13 | { |
el19tb | 11:cc5861abfca5 | 14 | public: |
el19tb | 29:2151cd327a36 | 15 | |
el19tb | 29:2151cd327a36 | 16 | GraphicEngine *graphics; // local renderer object |
el19tb | 42:04e326dcf09b | 17 | Level *level; // local level object |
el19tb | 29:2151cd327a36 | 18 | Frog *frog; |
el19tb | 37:65c9e5a65738 | 19 | int grid; // size of one game unit |
el19tb | 37:65c9e5a65738 | 20 | |
el19tb | 37:65c9e5a65738 | 21 | Frogger(GraphicEngine *engine, Level *levelptr, Frog *frog, int grid, int w, int h); // constructor |
el19tb | 37:65c9e5a65738 | 22 | |
el19tb | 37:65c9e5a65738 | 23 | public: |
el19tb | 37:65c9e5a65738 | 24 | int current_level; |
el19tb | 29:2151cd327a36 | 25 | |
el19tb | 29:2151cd327a36 | 26 | public: |
el19tb | 29:2151cd327a36 | 27 | |
el19tb | 42:04e326dcf09b | 28 | Gamepad gamepad; // actual hardware object |
el19tb | 43:2cd1cfe07770 | 29 | |
el19tb | 15:b15bf9357cd9 | 30 | int row_number; |
el19tb | 18:6be4c3c94a3d | 31 | int grid_width; // screen width in grid units |
el19tb | 37:65c9e5a65738 | 32 | int lcd_w; |
el19tb | 37:65c9e5a65738 | 33 | int lcd_h; |
el19tb | 11:cc5861abfca5 | 34 | |
el19tb | 2:86cef2afa648 | 35 | public: |
el19tb | 2:86cef2afa648 | 36 | void start(); |
el19tb | 2:86cef2afa648 | 37 | void input(); |
el19tb | 2:86cef2afa648 | 38 | void process_input(); |
el19tb | 2:86cef2afa648 | 39 | void clear(); |
el19tb | 42:04e326dcf09b | 40 | |
el19tb | 42:04e326dcf09b | 41 | void runCurrentLevel(); |
el19tb | 42:04e326dcf09b | 42 | void initializeLevelTwo(); |
el19tb | 42:04e326dcf09b | 43 | void initializeParams(int w, int h, int grid); |
el19tb | 42:04e326dcf09b | 44 | void initializeEmbeddedSystem(); |
el19tb | 42:04e326dcf09b | 45 | void checkCurrentLevelCollision(); |
el19tb | 42:04e326dcf09b | 46 | void checkIfFrogIsInWater(); |
el19tb | 42:04e326dcf09b | 47 | void moveFrog(int xWay, int yWay); |
el19tb | 2:86cef2afa648 | 48 | void game(); |
el19tb | 2:86cef2afa648 | 49 | void refresh(); |
el19tb | 42:04e326dcf09b | 50 | void createWaterLane(); |
el19tb | 42:04e326dcf09b | 51 | void createMultipleLanesWater(); |
el19tb | 42:04e326dcf09b | 52 | void drawRoadObjects(); |
el19tb | 42:04e326dcf09b | 53 | void createRoadLane(); |
el19tb | 42:04e326dcf09b | 54 | void createMultipleRoadLane(); |
el19tb | 42:04e326dcf09b | 55 | void drawSafety(); |
el19tb | 42:04e326dcf09b | 56 | void createSafetyObject(); |
el19tb | 42:04e326dcf09b | 57 | void createMultipleSafetyLane(); |
el19tb | 42:04e326dcf09b | 58 | |
el19tb | 42:04e326dcf09b | 59 | void drawEndPost(); |
el19tb | 42:04e326dcf09b | 60 | void drawWater(); |
el19tb | 42:04e326dcf09b | 61 | void loopWater(); |
el19tb | 42:04e326dcf09b | 62 | void moveWater(); |
el19tb | 3:648c9d5001be | 63 | |
el19tb | 3:648c9d5001be | 64 | void moveChicken(int xWay, int yWay); |
el19tb | 3:648c9d5001be | 65 | |
el19tb | 3:648c9d5001be | 66 | void move(); |
el19tb | 3:648c9d5001be | 67 | |
el19tb | 3:648c9d5001be | 68 | void setup(); |
el19tb | 42:04e326dcf09b | 69 | void createGoalPost(); |
el19tb | 2:86cef2afa648 | 70 | }; |
el19tb | 2:86cef2afa648 | 71 | |
el19tb | 2:86cef2afa648 | 72 | |
el19tb | 43:2cd1cfe07770 | 73 | #endif |