Dependencies: 4DGL-uLCD-SE SDFileSystem mbed-rtos mbed wave_player
graphics.h@0:b1c6f91ae4e2, 2016-10-31 (annotated)
- Committer:
- kferri6
- Date:
- Mon Oct 31 21:58:57 2016 +0000
- Revision:
- 0:b1c6f91ae4e2
metroid
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kferri6 | 0:b1c6f91ae4e2 | 1 | #include <mbed.h> |
kferri6 | 0:b1c6f91ae4e2 | 2 | |
kferri6 | 0:b1c6f91ae4e2 | 3 | |
kferri6 | 0:b1c6f91ae4e2 | 4 | |
kferri6 | 0:b1c6f91ae4e2 | 5 | |
kferri6 | 0:b1c6f91ae4e2 | 6 | class Samus{ |
kferri6 | 0:b1c6f91ae4e2 | 7 | public: |
kferri6 | 0:b1c6f91ae4e2 | 8 | Samus(); |
kferri6 | 0:b1c6f91ae4e2 | 9 | int health; |
kferri6 | 0:b1c6f91ae4e2 | 10 | bool isAlive; |
kferri6 | 0:b1c6f91ae4e2 | 11 | bool crouch; |
kferri6 | 0:b1c6f91ae4e2 | 12 | bool isJumping; |
kferri6 | 0:b1c6f91ae4e2 | 13 | int jump; |
kferri6 | 0:b1c6f91ae4e2 | 14 | int xpos; |
kferri6 | 0:b1c6f91ae4e2 | 15 | int ypos; |
kferri6 | 0:b1c6f91ae4e2 | 16 | int prevxpos; |
kferri6 | 0:b1c6f91ae4e2 | 17 | int prevypos; |
kferri6 | 0:b1c6f91ae4e2 | 18 | int height; |
kferri6 | 0:b1c6f91ae4e2 | 19 | int crouchheight; |
kferri6 | 0:b1c6f91ae4e2 | 20 | int currentheight; |
kferri6 | 0:b1c6f91ae4e2 | 21 | }; |
kferri6 | 0:b1c6f91ae4e2 | 22 | |
kferri6 | 0:b1c6f91ae4e2 | 23 | |
kferri6 | 0:b1c6f91ae4e2 | 24 | class Metroid{ |
kferri6 | 0:b1c6f91ae4e2 | 25 | public: |
kferri6 | 0:b1c6f91ae4e2 | 26 | Metroid(); |
kferri6 | 0:b1c6f91ae4e2 | 27 | void Move(int a){ |
kferri6 | 0:b1c6f91ae4e2 | 28 | prevxpos[a]=xpos[a]; |
kferri6 | 0:b1c6f91ae4e2 | 29 | xpos[a]=xpos[a]+2; |
kferri6 | 0:b1c6f91ae4e2 | 30 | //wait(.5); |
kferri6 | 0:b1c6f91ae4e2 | 31 | } |
kferri6 | 0:b1c6f91ae4e2 | 32 | bool isAlive[3]; |
kferri6 | 0:b1c6f91ae4e2 | 33 | int xpos[3]; |
kferri6 | 0:b1c6f91ae4e2 | 34 | int prevxpos[3]; |
kferri6 | 0:b1c6f91ae4e2 | 35 | int ypos[3]; |
kferri6 | 0:b1c6f91ae4e2 | 36 | int prevypos[3]; |
kferri6 | 0:b1c6f91ae4e2 | 37 | int radius; |
kferri6 | 0:b1c6f91ae4e2 | 38 | }; |
kferri6 | 0:b1c6f91ae4e2 | 39 | |
kferri6 | 0:b1c6f91ae4e2 | 40 | |
kferri6 | 0:b1c6f91ae4e2 | 41 | class Gunshot{ |
kferri6 | 0:b1c6f91ae4e2 | 42 | public: |
kferri6 | 0:b1c6f91ae4e2 | 43 | Gunshot(); |
kferri6 | 0:b1c6f91ae4e2 | 44 | bool isOnScreen; |
kferri6 | 0:b1c6f91ae4e2 | 45 | void Move(){ |
kferri6 | 0:b1c6f91ae4e2 | 46 | xpos=xpos-3; |
kferri6 | 0:b1c6f91ae4e2 | 47 | //wait(.5); |
kferri6 | 0:b1c6f91ae4e2 | 48 | } |
kferri6 | 0:b1c6f91ae4e2 | 49 | int radius; |
kferri6 | 0:b1c6f91ae4e2 | 50 | int prevxpos; |
kferri6 | 0:b1c6f91ae4e2 | 51 | int prevypos; |
kferri6 | 0:b1c6f91ae4e2 | 52 | int xpos; |
kferri6 | 0:b1c6f91ae4e2 | 53 | int ypos; |
kferri6 | 0:b1c6f91ae4e2 | 54 | }; |