Library that draws a basket on a Nokia N5110 LCD display and allows it to be moved left/right on the display using buttons or a joystick.

Dependents:   Game_Controller_Project

Committer:
Nathanj94
Date:
Tue Apr 18 14:27:06 2017 +0000
Revision:
8:48c5adc809e1
Parent:
6:2aec1ed2a75a
Child:
9:05fd30d491f1
Basket can be moved correctly/consistently with L and R buttons

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Nathanj94 0:7e132fca6044 1 #ifndef BASKET_H
Nathanj94 0:7e132fca6044 2 #define BASKET_H
Nathanj94 0:7e132fca6044 3
Nathanj94 0:7e132fca6044 4 #include "mbed.h"
Nathanj94 0:7e132fca6044 5 #include "N5110.h"
Nathanj94 0:7e132fca6044 6 #include "Gamepad.h"
Nathanj94 0:7e132fca6044 7
Nathanj94 0:7e132fca6044 8 class Basket
Nathanj94 0:7e132fca6044 9 {
Nathanj94 0:7e132fca6044 10 public:
Nathanj94 2:5d4f2c3f3c0a 11
Nathanj94 0:7e132fca6044 12 Basket();
Nathanj94 0:7e132fca6044 13 ~Basket();
Nathanj94 5:32421eb42841 14 void init(int y, int width);
Nathanj94 5:32421eb42841 15 void draw(N5110 &lcd);
Nathanj94 8:48c5adc809e1 16 void move_stick(Direction d, float mag);
Nathanj94 8:48c5adc809e1 17 void move_LR(Gamepad &pad);
Nathanj94 6:2aec1ed2a75a 18 void add_score_1();
Nathanj94 6:2aec1ed2a75a 19 void add_score_2();
Nathanj94 6:2aec1ed2a75a 20 void add_score_5();
Nathanj94 6:2aec1ed2a75a 21 void add_score_10();
Nathanj94 5:32421eb42841 22 int get_score();
Nathanj94 5:32421eb42841 23 int get_x();
Nathanj94 5:32421eb42841 24 int get_y();
Nathanj94 0:7e132fca6044 25
Nathanj94 0:7e132fca6044 26 private:
Nathanj94 2:5d4f2c3f3c0a 27
Nathanj94 5:32421eb42841 28 int y_ref;
Nathanj94 5:32421eb42841 29 int x_ref;
Nathanj94 0:7e132fca6044 30 int basket_width;
Nathanj94 5:32421eb42841 31 int stick_speed;
Nathanj94 5:32421eb42841 32 int bumper_speed;
Nathanj94 5:32421eb42841 33 int score;
Nathanj94 0:7e132fca6044 34
Nathanj94 0:7e132fca6044 35 };
Nathanj94 0:7e132fca6044 36 #endif
Nathanj94 0:7e132fca6044 37