Prints objects on to a Nokia N5110 LCD display and makes them 'fall' down the display.
Dependents: Game_Controller_Project
Objects.h@8:27e7d776ac0b, 2017-04-15 (annotated)
- Committer:
- Nathanj94
- Date:
- Sat Apr 15 15:05:52 2017 +0000
- Revision:
- 8:27e7d776ac0b
- Parent:
- 7:e567cd172d2a
- Child:
- 9:252abbc93565
Made the potentiometer dynamically control the speed at which objects fall, 5 settings included. Will later include UI design to choose speed before game
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Nathanj94 | 0:a1d36c50a0b7 | 1 | #ifndef OBJECTS_H |
Nathanj94 | 0:a1d36c50a0b7 | 2 | #define OBJECTS_H |
Nathanj94 | 0:a1d36c50a0b7 | 3 | |
Nathanj94 | 0:a1d36c50a0b7 | 4 | #include "mbed.h" |
Nathanj94 | 1:a05d10d3d33f | 5 | #include "N5110.h" |
Nathanj94 | 0:a1d36c50a0b7 | 6 | #include "Gamepad.h" |
Nathanj94 | 0:a1d36c50a0b7 | 7 | #include "Basket.h" |
Nathanj94 | 4:56ca80919a98 | 8 | #include "Fruit.h" |
Nathanj94 | 0:a1d36c50a0b7 | 9 | |
Nathanj94 | 0:a1d36c50a0b7 | 10 | class Objects |
Nathanj94 | 0:a1d36c50a0b7 | 11 | { |
Nathanj94 | 0:a1d36c50a0b7 | 12 | public: |
Nathanj94 | 0:a1d36c50a0b7 | 13 | |
Nathanj94 | 0:a1d36c50a0b7 | 14 | Objects(); |
Nathanj94 | 0:a1d36c50a0b7 | 15 | ~Objects(); |
Nathanj94 | 8:27e7d776ac0b | 16 | void init(float speed); |
Nathanj94 | 3:0c79211fdfe0 | 17 | void draw(N5110 &lcd); |
Nathanj94 | 3:0c79211fdfe0 | 18 | void undraw(N5110 &lcd); |
Nathanj94 | 8:27e7d776ac0b | 19 | void move(Gamepad &pad); |
Nathanj94 | 8:27e7d776ac0b | 20 | void bullet_time(); |
Nathanj94 | 5:217e18adcba7 | 21 | int get_score_var(); |
Nathanj94 | 7:e567cd172d2a | 22 | int get_undraw_var(); |
Nathanj94 | 3:0c79211fdfe0 | 23 | int get_x(); |
Nathanj94 | 3:0c79211fdfe0 | 24 | int get_y(); |
Nathanj94 | 1:a05d10d3d33f | 25 | |
Nathanj94 | 1:a05d10d3d33f | 26 | private: |
Nathanj94 | 1:a05d10d3d33f | 27 | |
Nathanj94 | 4:56ca80919a98 | 28 | Fruit fruit; |
Nathanj94 | 4:56ca80919a98 | 29 | |
Nathanj94 | 5:217e18adcba7 | 30 | int score_var; |
Nathanj94 | 4:56ca80919a98 | 31 | int undraw_var; |
Nathanj94 | 2:3f42da6a4c89 | 32 | int objects_size; |
Nathanj94 | 3:0c79211fdfe0 | 33 | int x_ref; |
Nathanj94 | 3:0c79211fdfe0 | 34 | int y_ref; |
Nathanj94 | 2:3f42da6a4c89 | 35 | int objects_ep; |
Nathanj94 | 8:27e7d776ac0b | 36 | float objects_speed; |
Nathanj94 | 4:56ca80919a98 | 37 | int objects_shape; |
Nathanj94 | 8:27e7d776ac0b | 38 | float pot_val; |
Nathanj94 | 4:56ca80919a98 | 39 | |
Nathanj94 | 1:a05d10d3d33f | 40 | }; |
Nathanj94 | 1:a05d10d3d33f | 41 | #endif |