James Heavey / Mbed 2 deprecated EL17JH

Dependencies:   mbed

Committer:
jamesheavey
Date:
Wed May 08 13:08:55 2019 +0000
Revision:
114:280903dd7e06
Parent:
111:4848c399fae0
Child:
129:b47c28c7eaaf
powerup class added and working

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jamesheavey 0:7d4d2023ed9c 1 #ifndef PADDLE_H
jamesheavey 0:7d4d2023ed9c 2 #define PADDLE_H
jamesheavey 0:7d4d2023ed9c 3
jamesheavey 0:7d4d2023ed9c 4 #include "mbed.h"
jamesheavey 0:7d4d2023ed9c 5 #include "N5110.h"
jamesheavey 0:7d4d2023ed9c 6 #include "Gamepad.h"
jamesheavey 0:7d4d2023ed9c 7
jamesheavey 86:01f33d94e496 8 #define PADDLE_WIDTH 15
jamesheavey 86:01f33d94e496 9 #define PADDLE_HEIGHT 2
jamesheavey 86:01f33d94e496 10
jamesheavey 86:01f33d94e496 11 /* Ball Class
jamesheavey 86:01f33d94e496 12 @author James Heavey, University of Leeds
jamesheavey 91:c01a736fb0d9 13 @brief Controls the paddle in the Breakout game
jamesheavey 86:01f33d94e496 14 @date May 2019
jamesheavey 91:c01a736fb0d9 15 */
jamesheavey 86:01f33d94e496 16
jamesheavey 0:7d4d2023ed9c 17 class Paddle
jamesheavey 0:7d4d2023ed9c 18 {
jamesheavey 0:7d4d2023ed9c 19 public:
jamesheavey 0:7d4d2023ed9c 20
jamesheavey 0:7d4d2023ed9c 21 Paddle();
jamesheavey 0:7d4d2023ed9c 22 ~Paddle();
jamesheavey 0:7d4d2023ed9c 23 void init(int x,int height,int width);
jamesheavey 0:7d4d2023ed9c 24 void draw(N5110 &lcd);
jamesheavey 0:7d4d2023ed9c 25 void update(Direction d,float mag);
jamesheavey 9:f6f0f39538c7 26 void lose_life();
jamesheavey 114:280903dd7e06 27 void inc_life();
jamesheavey 0:7d4d2023ed9c 28 Vector2D get_pos();
jamesheavey 9:f6f0f39538c7 29 int get_lives();
jamesheavey 111:4848c399fae0 30 void reset_lives();
jamesheavey 16:1761dfe801af 31 void set_tilt();
jamesheavey 16:1761dfe801af 32 void set_joy();
jamesheavey 69:db1354676fde 33 void recentre();
jamesheavey 72:7254d2a8a1cd 34 void set_sens(float sens);
jamesheavey 0:7d4d2023ed9c 35
jamesheavey 0:7d4d2023ed9c 36 private:
jamesheavey 0:7d4d2023ed9c 37
jamesheavey 0:7d4d2023ed9c 38 int _height;
jamesheavey 0:7d4d2023ed9c 39 int _width;
jamesheavey 0:7d4d2023ed9c 40 int _x;
jamesheavey 0:7d4d2023ed9c 41 int _y;
jamesheavey 0:7d4d2023ed9c 42 int _speed;
jamesheavey 0:7d4d2023ed9c 43 int _score;
jamesheavey 9:f6f0f39538c7 44 int _lives;
jamesheavey 72:7254d2a8a1cd 45 float _sens;
jamesheavey 16:1761dfe801af 46 bool _tilt;
jamesheavey 0:7d4d2023ed9c 47
jamesheavey 91:c01a736fb0d9 48
jamesheavey 0:7d4d2023ed9c 49 };
jamesheavey 0:7d4d2023ed9c 50 #endif