test 1 doc

Dependencies:   mbed Gamepad2

Committer:
joebarhouch
Date:
Fri Apr 10 19:07:13 2020 +0000
Revision:
2:f22cb01c43bc
Child:
3:e4e1cbf750b6
Player control V1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
joebarhouch 2:f22cb01c43bc 1 #ifndef PLAYER_H
joebarhouch 2:f22cb01c43bc 2 #define PLAYER_H
joebarhouch 2:f22cb01c43bc 3
joebarhouch 2:f22cb01c43bc 4 #include "mbed.h"
joebarhouch 2:f22cb01c43bc 5 #include "N5110.h"
joebarhouch 2:f22cb01c43bc 6 #include "Gamepad.h"
joebarhouch 2:f22cb01c43bc 7 #include "Bitmap.h"
joebarhouch 2:f22cb01c43bc 8
joebarhouch 2:f22cb01c43bc 9
joebarhouch 2:f22cb01c43bc 10
joebarhouch 2:f22cb01c43bc 11 int player_sprite[] = {
joebarhouch 2:f22cb01c43bc 12 1,1,1,1,1,1,1,0,0,
joebarhouch 2:f22cb01c43bc 13 1,1,1,1,1,1,1,0,0,
joebarhouch 2:f22cb01c43bc 14 1,1,1,0,1,0,1,0,0,
joebarhouch 2:f22cb01c43bc 15 1,1,1,0,1,0,1,1,1,
joebarhouch 2:f22cb01c43bc 16 1,1,1,0,1,0,1,1,0,
joebarhouch 2:f22cb01c43bc 17 1,1,1,1,1,1,1,0,0,
joebarhouch 2:f22cb01c43bc 18 0,1,1,0,1,1,0,0,0,
joebarhouch 2:f22cb01c43bc 19 0,1,1,0,1,1,0,0,0
joebarhouch 2:f22cb01c43bc 20 };
joebarhouch 2:f22cb01c43bc 21
joebarhouch 2:f22cb01c43bc 22
joebarhouch 2:f22cb01c43bc 23 int player_inv_sprite[] = {
joebarhouch 2:f22cb01c43bc 24 0,0,1,1,1,1,1,1,1,
joebarhouch 2:f22cb01c43bc 25 0,0,1,1,1,1,1,1,1,
joebarhouch 2:f22cb01c43bc 26 0,0,1,0,1,0,1,1,1,
joebarhouch 2:f22cb01c43bc 27 1,1,1,0,1,0,1,1,1,
joebarhouch 2:f22cb01c43bc 28 0,1,1,0,1,0,1,1,1,
joebarhouch 2:f22cb01c43bc 29 0,1,1,1,1,1,1,1,1,
joebarhouch 2:f22cb01c43bc 30 0,0,0,1,1,0,1,1,0,
joebarhouch 2:f22cb01c43bc 31 0,0,0,1,1,0,1,1,0
joebarhouch 2:f22cb01c43bc 32 };
joebarhouch 2:f22cb01c43bc 33
joebarhouch 2:f22cb01c43bc 34
joebarhouch 2:f22cb01c43bc 35
joebarhouch 2:f22cb01c43bc 36 Bitmap player(player_sprite, 8, 9);
joebarhouch 2:f22cb01c43bc 37 Bitmap player_inv(player_inv_sprite, 8, 9);
joebarhouch 2:f22cb01c43bc 38
joebarhouch 2:f22cb01c43bc 39
joebarhouch 2:f22cb01c43bc 40
joebarhouch 2:f22cb01c43bc 41 class Player
joebarhouch 2:f22cb01c43bc 42 {
joebarhouch 2:f22cb01c43bc 43 public:
joebarhouch 2:f22cb01c43bc 44 Player();
joebarhouch 2:f22cb01c43bc 45 ~Player();
joebarhouch 2:f22cb01c43bc 46
joebarhouch 2:f22cb01c43bc 47 void init();
joebarhouch 2:f22cb01c43bc 48 bool health;
joebarhouch 2:f22cb01c43bc 49 bool jump();
joebarhouch 2:f22cb01c43bc 50 bool is_jumping();
joebarhouch 2:f22cb01c43bc 51 bool dir();
joebarhouch 2:f22cb01c43bc 52 void draw(N5110 &lcd);
joebarhouch 2:f22cb01c43bc 53
joebarhouch 2:f22cb01c43bc 54 private:
joebarhouch 2:f22cb01c43bc 55 int _vx;
joebarhouch 2:f22cb01c43bc 56 int _vy;
joebarhouch 2:f22cb01c43bc 57 int _playerX;
joebarhouch 2:f22cb01c43bc 58 int _playerY;
joebarhouch 2:f22cb01c43bc 59 bool _direction;
joebarhouch 2:f22cb01c43bc 60 bool _jmp;
joebarhouch 2:f22cb01c43bc 61
joebarhouch 2:f22cb01c43bc 62 };
joebarhouch 2:f22cb01c43bc 63
joebarhouch 2:f22cb01c43bc 64 #endif