ELEC2645 (2018/19) / Mbed 2 deprecated EL17MCD

Dependencies:   mbed

Committer:
el17mcd
Date:
Sun Apr 14 15:58:12 2019 +0000
Revision:
12:9e6d5d0a0c82
Child:
13:feadff02d3f7
! TankL class changed into generic Tank class. Separate graphics class to house and govern the use of sprites. Game now can produce two tanks on the screen facing opposite directions. They can take turns to fire projectiles based off joystick angle.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
el17mcd 12:9e6d5d0a0c82 1 #ifndef GRAPHICS
el17mcd 12:9e6d5d0a0c82 2 #define GRAPHICS
el17mcd 12:9e6d5d0a0c82 3
el17mcd 12:9e6d5d0a0c82 4 #include "mbed.h"
el17mcd 12:9e6d5d0a0c82 5 #include "N5110.h"
el17mcd 12:9e6d5d0a0c82 6 #include "Gamepad.h"
el17mcd 12:9e6d5d0a0c82 7
el17mcd 12:9e6d5d0a0c82 8 class Graphics
el17mcd 12:9e6d5d0a0c82 9 {
el17mcd 12:9e6d5d0a0c82 10 public:
el17mcd 12:9e6d5d0a0c82 11
el17mcd 12:9e6d5d0a0c82 12 Graphics();
el17mcd 12:9e6d5d0a0c82 13 ~Graphics();
el17mcd 12:9e6d5d0a0c82 14 // Left Tank
el17mcd 12:9e6d5d0a0c82 15 void draw_tank_l(int x, int y, N5110 &lcd);
el17mcd 12:9e6d5d0a0c82 16 void draw_turret_l(int x, int y, int angle, N5110 &lcd);
el17mcd 12:9e6d5d0a0c82 17 // Right Tank
el17mcd 12:9e6d5d0a0c82 18 void draw_tank_r(int x, int y, N5110 &lcd);
el17mcd 12:9e6d5d0a0c82 19 void draw_turret_r(int x, int y, int angle, N5110 &lcd);
el17mcd 12:9e6d5d0a0c82 20 // Projectile
el17mcd 12:9e6d5d0a0c82 21 void draw_projectile(int x, int y, N5110 &lcd);
el17mcd 12:9e6d5d0a0c82 22 // Maps
el17mcd 12:9e6d5d0a0c82 23
el17mcd 12:9e6d5d0a0c82 24 private:
el17mcd 12:9e6d5d0a0c82 25 // Left Tank
el17mcd 12:9e6d5d0a0c82 26 void _turret_angle_l1(int x, int y, N5110 &lcd);
el17mcd 12:9e6d5d0a0c82 27 void _turret_angle_l2(int x, int y, N5110 &lcd);
el17mcd 12:9e6d5d0a0c82 28 void _turret_angle_l3(int x, int y, N5110 &lcd);
el17mcd 12:9e6d5d0a0c82 29 void _turret_angle_l4(int x, int y, N5110 &lcd);
el17mcd 12:9e6d5d0a0c82 30 void _turret_angle_l5(int x, int y, N5110 &lcd);
el17mcd 12:9e6d5d0a0c82 31 // Right Tank
el17mcd 12:9e6d5d0a0c82 32 void _turret_angle_r1(int x, int y, N5110 &lcd);
el17mcd 12:9e6d5d0a0c82 33 void _turret_angle_r2(int x, int y, N5110 &lcd);
el17mcd 12:9e6d5d0a0c82 34 void _turret_angle_r3(int x, int y, N5110 &lcd);
el17mcd 12:9e6d5d0a0c82 35 void _turret_angle_r4(int x, int y, N5110 &lcd);
el17mcd 12:9e6d5d0a0c82 36 void _turret_angle_r5(int x, int y, N5110 &lcd);
el17mcd 12:9e6d5d0a0c82 37 };
el17mcd 12:9e6d5d0a0c82 38
el17mcd 12:9e6d5d0a0c82 39
el17mcd 12:9e6d5d0a0c82 40
el17mcd 12:9e6d5d0a0c82 41 #endif // GRAPHICS