Rex Raj / Mbed 2 deprecated el17rrrs

Dependencies:   mbed Gamepad N5110 mbed-rtos

Committer:
RexRoshan
Date:
Sat Apr 13 01:13:53 2019 +0000
Revision:
0:99fa5a619081
Child:
1:45493d1d0689
Mission 1 & 2 works perfectly

Who changed what in which revision?

UserRevisionLine numberNew contents of line
RexRoshan 0:99fa5a619081 1 #include "GameEngine.h"
RexRoshan 0:99fa5a619081 2
RexRoshan 0:99fa5a619081 3 GameEngine::GameEngine()
RexRoshan 0:99fa5a619081 4 {
RexRoshan 0:99fa5a619081 5
RexRoshan 0:99fa5a619081 6 }
RexRoshan 0:99fa5a619081 7
RexRoshan 0:99fa5a619081 8 GameEngine::~GameEngine()
RexRoshan 0:99fa5a619081 9 {
RexRoshan 0:99fa5a619081 10
RexRoshan 0:99fa5a619081 11 }
RexRoshan 0:99fa5a619081 12 int backgrounds [48][84] = {
RexRoshan 0:99fa5a619081 13
RexRoshan 0:99fa5a619081 14 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
RexRoshan 0:99fa5a619081 15 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
RexRoshan 0:99fa5a619081 16 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
RexRoshan 0:99fa5a619081 61 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
RexRoshan 0:99fa5a619081 62
RexRoshan 0:99fa5a619081 63 };
RexRoshan 0:99fa5a619081 64 int r [3][13] = {
RexRoshan 0:99fa5a619081 65
RexRoshan 0:99fa5a619081 66 {0,1,0,0,0,0,0,0,0,0,0,1,0},
RexRoshan 0:99fa5a619081 67 {1,1,1,0,0,0,0,0,0,0,1,1,1},
RexRoshan 0:99fa5a619081 68 {0,1,0,0,1,1,1,1,1,0,0,1,0},
RexRoshan 0:99fa5a619081 69
RexRoshan 0:99fa5a619081 70 };
RexRoshan 0:99fa5a619081 71
RexRoshan 0:99fa5a619081 72 int e [3][3] = {
RexRoshan 0:99fa5a619081 73
RexRoshan 0:99fa5a619081 74 {0,1,0},
RexRoshan 0:99fa5a619081 75 {1,1,1},
RexRoshan 0:99fa5a619081 76 {0,1,0},
RexRoshan 0:99fa5a619081 77
RexRoshan 0:99fa5a619081 78 };
RexRoshan 0:99fa5a619081 79
RexRoshan 0:99fa5a619081 80 int x [3][19] = {
RexRoshan 0:99fa5a619081 81
RexRoshan 0:99fa5a619081 82 {0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0},
RexRoshan 0:99fa5a619081 83 {0,0,0,0,0,0,1,1,1,0,1,1,1,0,0,0,0,0,0},
RexRoshan 0:99fa5a619081 84 {1,1,1,1,1,0,0,1,0,0,0,1,0,0,1,1,1,1,1},
RexRoshan 0:99fa5a619081 85
RexRoshan 0:99fa5a619081 86 };
RexRoshan 0:99fa5a619081 87
RexRoshan 0:99fa5a619081 88 int explosion [23] [23] = {
RexRoshan 0:99fa5a619081 89
RexRoshan 0:99fa5a619081 90 {0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},
RexRoshan 0:99fa5a619081 91 {0,0,0,0,0,0,1,1,1,1,0,0,1,1,1,1,1,0,0,0,0,0,0},
RexRoshan 0:99fa5a619081 92 {0,0,0,0,0,1,1,1,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0},
RexRoshan 0:99fa5a619081 93 {0,0,0,0,1,1,1,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,0},
RexRoshan 0:99fa5a619081 94 {0,0,0,1,1,1,0,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,0},
RexRoshan 0:99fa5a619081 95 {0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0},
RexRoshan 0:99fa5a619081 96 {0,1,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,1,1,1,0},
RexRoshan 0:99fa5a619081 97 {0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,0},
RexRoshan 0:99fa5a619081 98 {0,1,1,0,0,0,0,1,1,1,0,0,0,0,1,0,0,0,0,0,1,0,0},
RexRoshan 0:99fa5a619081 99 {0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,0},
RexRoshan 0:99fa5a619081 100 {0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
RexRoshan 0:99fa5a619081 101 {0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1},
RexRoshan 0:99fa5a619081 102 {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1},
RexRoshan 0:99fa5a619081 103 {0,1,1,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0},
RexRoshan 0:99fa5a619081 104 {0,1,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0},
RexRoshan 0:99fa5a619081 105 {0,0,1,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,1,0,0},
RexRoshan 0:99fa5a619081 106 {0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0},
RexRoshan 0:99fa5a619081 107 {0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0},
RexRoshan 0:99fa5a619081 108 {0,1,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,1,1,1,1,0,0},
RexRoshan 0:99fa5a619081 109 {0,0,1,1,1,1,0,0,0,1,1,1,0,0,0,0,1,1,1,1,0,0,0},
RexRoshan 0:99fa5a619081 110 {0,0,0,1,1,1,0,0,1,1,0,1,1,0,0,0,1,1,0,0,0,0,0},
RexRoshan 0:99fa5a619081 111 {0,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,0,0,0,0,0,0,0},
RexRoshan 0:99fa5a619081 112 {0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0},
RexRoshan 0:99fa5a619081 113
RexRoshan 0:99fa5a619081 114 };
RexRoshan 0:99fa5a619081 115
RexRoshan 0:99fa5a619081 116 void GameEngine::init(int spacecraft_xpos,int spacecraft_ypos,int enemy_xpos, int enemy_ypos,int enemy2_xpos, int enemy2_ypos,int beam_size,int beam2_size, int speed)
RexRoshan 0:99fa5a619081 117 {
RexRoshan 0:99fa5a619081 118 // initialise the game parameters
RexRoshan 0:99fa5a619081 119 _spacecraft_xpos = spacecraft_xpos;
RexRoshan 0:99fa5a619081 120 _spacecraft_ypos = spacecraft_ypos;
RexRoshan 0:99fa5a619081 121
RexRoshan 0:99fa5a619081 122 _enemy_xpos = enemy_xpos;
RexRoshan 0:99fa5a619081 123 _enemy_ypos = enemy_ypos;
RexRoshan 0:99fa5a619081 124
RexRoshan 0:99fa5a619081 125 _enemy2_xpos = enemy2_xpos;
RexRoshan 0:99fa5a619081 126 _enemy2_ypos = enemy2_ypos;
RexRoshan 0:99fa5a619081 127
RexRoshan 0:99fa5a619081 128
RexRoshan 0:99fa5a619081 129 _beam_size = beam_size;
RexRoshan 0:99fa5a619081 130 _beam2_size = beam2_size;
RexRoshan 0:99fa5a619081 131 _speed = speed;
RexRoshan 0:99fa5a619081 132
RexRoshan 0:99fa5a619081 133
RexRoshan 0:99fa5a619081 134 _p1x = GAP;
RexRoshan 0:99fa5a619081 135 // x position on screen - WIDTH is defined in N5110.h
RexRoshan 0:99fa5a619081 136 _e1a = WIDTH-_enemy_xpos; //12
RexRoshan 0:99fa5a619081 137 _e1b = HEIGHT/2-_enemy_ypos;//4
RexRoshan 0:99fa5a619081 138
RexRoshan 0:99fa5a619081 139 _e2a = WIDTH-_enemy2_xpos; //12
RexRoshan 0:99fa5a619081 140 _e21b = HEIGHT/2 +_enemy2_ypos;
RexRoshan 0:99fa5a619081 141 _e22b = HEIGHT/2 -_enemy2_ypos;//4
RexRoshan 0:99fa5a619081 142 // puts spacecraft and enemy in middle
RexRoshan 0:99fa5a619081 143 _p1.init(_spacecraft_xpos,_spacecraft_ypos);
RexRoshan 0:99fa5a619081 144 _e1.init(_e1a,_e1b);
RexRoshan 0:99fa5a619081 145 _e21.init(_e2a,_e21b,_speed);
RexRoshan 0:99fa5a619081 146 _e22.init(_e2a,_e22b,_speed);
RexRoshan 0:99fa5a619081 147 _stage = 0;
RexRoshan 0:99fa5a619081 148 //_enemybeam.init(_beam_size,_e1a,_e1b);
RexRoshan 0:99fa5a619081 149
RexRoshan 0:99fa5a619081 150 }
RexRoshan 0:99fa5a619081 151
RexRoshan 0:99fa5a619081 152 void GameEngine::read_input(Gamepad &pad)
RexRoshan 0:99fa5a619081 153 {
RexRoshan 0:99fa5a619081 154 _d = pad.get_direction();
RexRoshan 0:99fa5a619081 155 _mag = pad.get_mag();
RexRoshan 0:99fa5a619081 156 _R = pad.check_event(Gamepad::R_PRESSED);
RexRoshan 0:99fa5a619081 157
RexRoshan 0:99fa5a619081 158 }
RexRoshan 0:99fa5a619081 159
RexRoshan 0:99fa5a619081 160 void GameEngine::draw(Gamepad &pad,N5110 &lcd)
RexRoshan 0:99fa5a619081 161 {
RexRoshan 0:99fa5a619081 162 // draw the background of the game
RexRoshan 0:99fa5a619081 163 lcd.drawSprite(0,0,48,84,(int *)backgrounds);
RexRoshan 0:99fa5a619081 164 lcd.drawSprite(6,4,3,13,(int *)r);
RexRoshan 0:99fa5a619081 165 //health
RexRoshan 0:99fa5a619081 166 draw_enemy_health(lcd);
RexRoshan 0:99fa5a619081 167 draw_spacecraft_health(pad);
RexRoshan 0:99fa5a619081 168 // spacecraft
RexRoshan 0:99fa5a619081 169 _p1.character(lcd);
RexRoshan 0:99fa5a619081 170 // enemy 1
RexRoshan 0:99fa5a619081 171 _e1.enemy(lcd);
RexRoshan 0:99fa5a619081 172 // spacecraft beam
RexRoshan 0:99fa5a619081 173 _beam.draw(lcd);
RexRoshan 0:99fa5a619081 174 // enemy beam
RexRoshan 0:99fa5a619081 175 _enemybeam.draw(lcd);
RexRoshan 0:99fa5a619081 176 // level one completion
RexRoshan 0:99fa5a619081 177 // mission_one_complete(lcd);
RexRoshan 0:99fa5a619081 178 // level one fail
RexRoshan 0:99fa5a619081 179 // mission_one_fail(lcd,pad);
RexRoshan 0:99fa5a619081 180
RexRoshan 0:99fa5a619081 181
RexRoshan 0:99fa5a619081 182 }
RexRoshan 0:99fa5a619081 183 void GameEngine::draw2(Gamepad &pad,N5110 &lcd)
RexRoshan 0:99fa5a619081 184 {
RexRoshan 0:99fa5a619081 185 lcd.drawSprite(0,0,48,84,(int *)backgrounds);
RexRoshan 0:99fa5a619081 186 lcd.drawSprite(6,4,3,3,(int *)e);
RexRoshan 0:99fa5a619081 187 draw_spacecraft_health(pad);
RexRoshan 0:99fa5a619081 188 draw_enemy21_health(lcd);
RexRoshan 0:99fa5a619081 189 draw_enemy22_health(lcd);
RexRoshan 0:99fa5a619081 190 // spacecraft
RexRoshan 0:99fa5a619081 191 _p1.character(lcd);
RexRoshan 0:99fa5a619081 192 _e21.enemy2(lcd);
RexRoshan 0:99fa5a619081 193 _e22.enemy2(lcd);
RexRoshan 0:99fa5a619081 194 _beam.draw(lcd);
RexRoshan 0:99fa5a619081 195 _enemybeam2.draw(lcd);
RexRoshan 0:99fa5a619081 196
RexRoshan 0:99fa5a619081 197 }
RexRoshan 0:99fa5a619081 198
RexRoshan 0:99fa5a619081 199 void GameEngine::update(Gamepad &pad,N5110 &lcd)
RexRoshan 0:99fa5a619081 200 {
RexRoshan 0:99fa5a619081 201 check_goal(pad);
RexRoshan 0:99fa5a619081 202 check_enemybeam_collisions(pad);
RexRoshan 0:99fa5a619081 203 // check_beam_pressed(pad,lcd);
RexRoshan 0:99fa5a619081 204 // important to update paddles and ball before checking collisions so can
RexRoshan 0:99fa5a619081 205 // correct for it before updating the display
RexRoshan 0:99fa5a619081 206 _p1.update(_d,_mag);
RexRoshan 0:99fa5a619081 207 _beam.update();
RexRoshan 0:99fa5a619081 208 _enemybeam.update();
RexRoshan 0:99fa5a619081 209 check_enemy_collisions(pad);
RexRoshan 0:99fa5a619081 210 check_spacecraft_collisions(pad);
RexRoshan 0:99fa5a619081 211 spacecraft_dead(lcd,pad);
RexRoshan 0:99fa5a619081 212 enemy_dead(lcd,pad);
RexRoshan 0:99fa5a619081 213 check_mission_one(pad);
RexRoshan 0:99fa5a619081 214 // if (_second_mission == true){
RexRoshan 0:99fa5a619081 215 // _p1.update(_d,_mag);
RexRoshan 0:99fa5a619081 216 // _e21.update();
RexRoshan 0:99fa5a619081 217 // _e22.update();
RexRoshan 0:99fa5a619081 218 }
RexRoshan 0:99fa5a619081 219
RexRoshan 0:99fa5a619081 220 void GameEngine::update2(Gamepad &pad,N5110 &lcd)
RexRoshan 0:99fa5a619081 221 {
RexRoshan 0:99fa5a619081 222 check_goal(pad);
RexRoshan 0:99fa5a619081 223 check_enemybeam2_collisions(pad);
RexRoshan 0:99fa5a619081 224 // check_beam_pressed(pad,lcd);
RexRoshan 0:99fa5a619081 225 // important to update paddles and ball before checking collisions so can
RexRoshan 0:99fa5a619081 226 // correct for it before updating the display
RexRoshan 0:99fa5a619081 227 _p1.update(_d,_mag);
RexRoshan 0:99fa5a619081 228 _beam.update();
RexRoshan 0:99fa5a619081 229 _enemybeam2.update();
RexRoshan 0:99fa5a619081 230 _e21.update();
RexRoshan 0:99fa5a619081 231 _e22.update();
RexRoshan 0:99fa5a619081 232 check_enemy2_collisions(pad);
RexRoshan 0:99fa5a619081 233 check_spacecraft2_collisions(pad);
RexRoshan 0:99fa5a619081 234 check_wall_collisions(pad);
RexRoshan 0:99fa5a619081 235 spacecraft2_dead(lcd,pad);
RexRoshan 0:99fa5a619081 236 enemy2_dead(lcd,pad);
RexRoshan 0:99fa5a619081 237 check_mission_two(pad);
RexRoshan 0:99fa5a619081 238
RexRoshan 0:99fa5a619081 239 }
RexRoshan 0:99fa5a619081 240
RexRoshan 0:99fa5a619081 241 void GameEngine::check_enemy_collisions(Gamepad &pad)
RexRoshan 0:99fa5a619081 242 {
RexRoshan 0:99fa5a619081 243
RexRoshan 0:99fa5a619081 244 Vector2D beam_pos = _beam.get_pos();
RexRoshan 0:99fa5a619081 245 // check e1 next
RexRoshan 0:99fa5a619081 246 Vector2D e1_pos = _e1.get_enemy_pos();
RexRoshan 0:99fa5a619081 247
RexRoshan 0:99fa5a619081 248 // see if ball has hit the paddle by checking for overlaps
RexRoshan 0:99fa5a619081 249 if (
RexRoshan 0:99fa5a619081 250 (beam_pos.y >= e1_pos.y) && //top
RexRoshan 0:99fa5a619081 251 (beam_pos.y <= e1_pos.y + 7) && //bottom
RexRoshan 0:99fa5a619081 252 (beam_pos.x + _beam_size >= _e1a) && //left
RexRoshan 0:99fa5a619081 253 (beam_pos.x + _beam_size <= _e1a + 8) //right
RexRoshan 0:99fa5a619081 254 ) {
RexRoshan 0:99fa5a619081 255 // if it has, fix position and reflect x velocity
RexRoshan 0:99fa5a619081 256 // beam_pos.x = _e1a - _beam_size;
RexRoshan 0:99fa5a619081 257 // beam_velocity.x = -beam_velocity.x;
RexRoshan 0:99fa5a619081 258 // audio feedback
RexRoshan 0:99fa5a619081 259 _e1.add_health();
RexRoshan 0:99fa5a619081 260 //_beam.init(_beam_size,p1_pos.x,p1_pos.y);
RexRoshan 0:99fa5a619081 261 pad.tone(1000.0,0.1);
RexRoshan 0:99fa5a619081 262 }
RexRoshan 0:99fa5a619081 263
RexRoshan 0:99fa5a619081 264 // write new attributes
RexRoshan 0:99fa5a619081 265 _beam.set_pos(beam_pos);
RexRoshan 0:99fa5a619081 266 }
RexRoshan 0:99fa5a619081 267
RexRoshan 0:99fa5a619081 268 void GameEngine::check_enemy2_collisions(Gamepad &pad)
RexRoshan 0:99fa5a619081 269 {
RexRoshan 0:99fa5a619081 270
RexRoshan 0:99fa5a619081 271 Vector2D beam_pos = _beam.get_pos();
RexRoshan 0:99fa5a619081 272 // check e1 next
RexRoshan 0:99fa5a619081 273 Vector2D e21_pos = _e21.get_enemy21_pos();
RexRoshan 0:99fa5a619081 274 Vector2D e22_pos = _e22.get_enemy22_pos();
RexRoshan 0:99fa5a619081 275
RexRoshan 0:99fa5a619081 276 // see if ball has hit the paddle by checking for overlaps
RexRoshan 0:99fa5a619081 277 if (
RexRoshan 0:99fa5a619081 278 (beam_pos.y >= e21_pos.y) && //top
RexRoshan 0:99fa5a619081 279 (beam_pos.y <= e21_pos.y + 7) && //bottom
RexRoshan 0:99fa5a619081 280 (beam_pos.x + _beam_size >= _e2a) && //left
RexRoshan 0:99fa5a619081 281 (beam_pos.x + _beam_size <= _e2a + 7) //right
RexRoshan 0:99fa5a619081 282 ) {
RexRoshan 0:99fa5a619081 283 // if it has, fix position and reflect x velocity
RexRoshan 0:99fa5a619081 284 // beam_pos.x = _e1a - _beam_size;
RexRoshan 0:99fa5a619081 285 // beam_velocity.x = -beam_velocity.x;
RexRoshan 0:99fa5a619081 286 // audio feedback
RexRoshan 0:99fa5a619081 287 _e21.add_health();
RexRoshan 0:99fa5a619081 288 //_beam.init(_beam_size,p1_pos.x,p1_pos.y);
RexRoshan 0:99fa5a619081 289 pad.tone(1000.0,0.1);
RexRoshan 0:99fa5a619081 290 }
RexRoshan 0:99fa5a619081 291 if (
RexRoshan 0:99fa5a619081 292 (beam_pos.y >= e22_pos.y) && //top
RexRoshan 0:99fa5a619081 293 (beam_pos.y <= e22_pos.y + 7) && //bottom
RexRoshan 0:99fa5a619081 294 (beam_pos.x + _beam_size >= _e2a) && //left
RexRoshan 0:99fa5a619081 295 (beam_pos.x + _beam_size <= _e2a + 7) //right
RexRoshan 0:99fa5a619081 296 ) {
RexRoshan 0:99fa5a619081 297 // if it has, fix position and reflect x velocity
RexRoshan 0:99fa5a619081 298 // beam_pos.x = _e1a - _beam_size;
RexRoshan 0:99fa5a619081 299 // beam_velocity.x = -beam_velocity.x;
RexRoshan 0:99fa5a619081 300 // audio feedback
RexRoshan 0:99fa5a619081 301 _e22.add_health();
RexRoshan 0:99fa5a619081 302 //_beam.init(_beam_size,p1_pos.x,p1_pos.y);
RexRoshan 0:99fa5a619081 303 pad.tone(1000.0,0.1);
RexRoshan 0:99fa5a619081 304 }
RexRoshan 0:99fa5a619081 305 // write new attributes
RexRoshan 0:99fa5a619081 306 _beam.set_pos(beam_pos);
RexRoshan 0:99fa5a619081 307 }
RexRoshan 0:99fa5a619081 308
RexRoshan 0:99fa5a619081 309 void GameEngine::check_goal(Gamepad &pad)
RexRoshan 0:99fa5a619081 310 {
RexRoshan 0:99fa5a619081 311 Vector2D p1_pos = _p1.get_pos();
RexRoshan 0:99fa5a619081 312 Vector2D beam_pos = _beam.get_pos();
RexRoshan 0:99fa5a619081 313 // P2 has scored
RexRoshan 0:99fa5a619081 314 if (beam_pos.x + _beam_size > WIDTH) {
RexRoshan 0:99fa5a619081 315 if(_R == true){
RexRoshan 0:99fa5a619081 316 _beam.init(_beam_size,p1_pos.x,p1_pos.y);
RexRoshan 0:99fa5a619081 317 }
RexRoshan 0:99fa5a619081 318 }
RexRoshan 0:99fa5a619081 319 }
RexRoshan 0:99fa5a619081 320
RexRoshan 0:99fa5a619081 321 void GameEngine::check_enemybeam_collisions(Gamepad &pad)
RexRoshan 0:99fa5a619081 322 {
RexRoshan 0:99fa5a619081 323 Vector2D enemybeam_pos = _enemybeam.get_pos();
RexRoshan 0:99fa5a619081 324 // P2 has scored
RexRoshan 0:99fa5a619081 325 if ((_ebeam == true)||(enemybeam_pos.x - _beam_size < 0)) {
RexRoshan 0:99fa5a619081 326 _enemybeam.init(_beam_size,_e1a,_e1b);
RexRoshan 0:99fa5a619081 327 _ebeam = false;
RexRoshan 0:99fa5a619081 328 }
RexRoshan 0:99fa5a619081 329 }
RexRoshan 0:99fa5a619081 330
RexRoshan 0:99fa5a619081 331 void GameEngine::check_enemybeam2_collisions(Gamepad &pad)
RexRoshan 0:99fa5a619081 332 {
RexRoshan 0:99fa5a619081 333 Vector2D enemy21_pos = _e21.get_enemy21_pos();
RexRoshan 0:99fa5a619081 334 Vector2D enemy22_pos = _e22.get_enemy22_pos();
RexRoshan 0:99fa5a619081 335 Vector2D enemybeam21_pos = _enemybeam2.get_pos_21();
RexRoshan 0:99fa5a619081 336 Vector2D enemybeam22_pos = _enemybeam2.get_pos_22();
RexRoshan 0:99fa5a619081 337 // P2 has scored
RexRoshan 0:99fa5a619081 338 if ((_ebeam21 == true)||(_ebeam22 == true)||(enemybeam21_pos.x - _beam2_size < 0)||(enemybeam22_pos.x - _beam2_size < 0)) {
RexRoshan 0:99fa5a619081 339 _enemybeam2.init(_beam2_size,enemy21_pos.x,enemy21_pos.y,enemy22_pos.x,enemy22_pos.y);
RexRoshan 0:99fa5a619081 340 _ebeam21 = false;
RexRoshan 0:99fa5a619081 341 _ebeam22 = false;
RexRoshan 0:99fa5a619081 342 }
RexRoshan 0:99fa5a619081 343 }
RexRoshan 0:99fa5a619081 344
RexRoshan 0:99fa5a619081 345 void GameEngine::check_spacecraft_collisions(Gamepad &pad)
RexRoshan 0:99fa5a619081 346 {
RexRoshan 0:99fa5a619081 347 Vector2D enemybeam_pos = _enemybeam.get_pos();
RexRoshan 0:99fa5a619081 348 Vector2D p1_pos = _p1.get_pos();
RexRoshan 0:99fa5a619081 349
RexRoshan 0:99fa5a619081 350 // see if beam has hit the enemy by checking for overlaps
RexRoshan 0:99fa5a619081 351 if (
RexRoshan 0:99fa5a619081 352 (enemybeam_pos.y >= p1_pos.y) && //top
RexRoshan 0:99fa5a619081 353 (enemybeam_pos.y <= p1_pos.y + 11) && //bottom
RexRoshan 0:99fa5a619081 354 (enemybeam_pos.x >= _p1x) && //left
RexRoshan 0:99fa5a619081 355 (enemybeam_pos.x <= _p1x + 11) //right
RexRoshan 0:99fa5a619081 356 ) {
RexRoshan 0:99fa5a619081 357 _p1.add_health();
RexRoshan 0:99fa5a619081 358 _ebeam = true;
RexRoshan 0:99fa5a619081 359 pad.tone(1000.0,0.1);
RexRoshan 0:99fa5a619081 360 }
RexRoshan 0:99fa5a619081 361
RexRoshan 0:99fa5a619081 362 _enemybeam.set_pos(enemybeam_pos);
RexRoshan 0:99fa5a619081 363
RexRoshan 0:99fa5a619081 364 }
RexRoshan 0:99fa5a619081 365
RexRoshan 0:99fa5a619081 366 void GameEngine::check_spacecraft2_collisions(Gamepad &pad)
RexRoshan 0:99fa5a619081 367 {
RexRoshan 0:99fa5a619081 368 Vector2D enemybeam21_pos = _enemybeam2.get_pos_21();
RexRoshan 0:99fa5a619081 369 Vector2D enemybeam22_pos = _enemybeam2.get_pos_22();
RexRoshan 0:99fa5a619081 370 Vector2D p1_pos = _p1.get_pos();
RexRoshan 0:99fa5a619081 371
RexRoshan 0:99fa5a619081 372 // see if beam has hit the enemy by checking for overlaps
RexRoshan 0:99fa5a619081 373 if (
RexRoshan 0:99fa5a619081 374 (enemybeam21_pos.y >= p1_pos.y) && //top
RexRoshan 0:99fa5a619081 375 (enemybeam21_pos.y <= p1_pos.y + 11) && //bottom
RexRoshan 0:99fa5a619081 376 (enemybeam21_pos.x >= _p1x) && //left
RexRoshan 0:99fa5a619081 377 (enemybeam21_pos.x <= _p1x + 11) //right
RexRoshan 0:99fa5a619081 378 ) {
RexRoshan 0:99fa5a619081 379 _p1.add_health();
RexRoshan 0:99fa5a619081 380 _ebeam21 = true;
RexRoshan 0:99fa5a619081 381 pad.tone(1000.0,0.1);
RexRoshan 0:99fa5a619081 382 }
RexRoshan 0:99fa5a619081 383 if (
RexRoshan 0:99fa5a619081 384 (enemybeam22_pos.y >= p1_pos.y) && //top
RexRoshan 0:99fa5a619081 385 (enemybeam22_pos.y <= p1_pos.y + 11) && //bottom
RexRoshan 0:99fa5a619081 386 (enemybeam22_pos.x >= _p1x) && //left
RexRoshan 0:99fa5a619081 387 (enemybeam22_pos.x <= _p1x + 11) //right
RexRoshan 0:99fa5a619081 388 ) {
RexRoshan 0:99fa5a619081 389 _p1.add_health();
RexRoshan 0:99fa5a619081 390 _ebeam22 = true;
RexRoshan 0:99fa5a619081 391 pad.tone(1000.0,0.1);
RexRoshan 0:99fa5a619081 392 }
RexRoshan 0:99fa5a619081 393 _enemybeam2.set_pos_21(enemybeam21_pos);
RexRoshan 0:99fa5a619081 394 _enemybeam2.set_pos_22(enemybeam22_pos);
RexRoshan 0:99fa5a619081 395
RexRoshan 0:99fa5a619081 396 }
RexRoshan 0:99fa5a619081 397 void GameEngine::check_wall_collisions(Gamepad &pad)
RexRoshan 0:99fa5a619081 398 {
RexRoshan 0:99fa5a619081 399 // read current ball attributes
RexRoshan 0:99fa5a619081 400 Vector2D enemy21_pos = _e21.get_enemy21_pos();
RexRoshan 0:99fa5a619081 401 Vector2D enemy22_pos = _e22.get_enemy22_pos();
RexRoshan 0:99fa5a619081 402 Vector2D enemy21_movement = _e21.get_movement();
RexRoshan 0:99fa5a619081 403 Vector2D enemy22_movement = _e22.get_movement();
RexRoshan 0:99fa5a619081 404
RexRoshan 0:99fa5a619081 405 // check if hit top wall
RexRoshan 0:99fa5a619081 406 if (enemy21_pos.y <= 1) { // 1 due to 1 pixel boundary
RexRoshan 0:99fa5a619081 407 enemy21_pos.y = 1; // bounce off ceiling without going off screen
RexRoshan 0:99fa5a619081 408 enemy21_movement.y = -enemy21_movement.y;
RexRoshan 0:99fa5a619081 409 }
RexRoshan 0:99fa5a619081 410 // check if hit bottom wall
RexRoshan 0:99fa5a619081 411 else if (enemy21_pos.y + 7 >= (HEIGHT-1) ) { // bottom pixel is 47
RexRoshan 0:99fa5a619081 412 // hit bottom
RexRoshan 0:99fa5a619081 413 enemy21_pos.y = (HEIGHT-1) - 7; // stops ball going off screen
RexRoshan 0:99fa5a619081 414 enemy21_movement.y = -enemy21_movement.y;
RexRoshan 0:99fa5a619081 415 // audio feedback
RexRoshan 0:99fa5a619081 416 } else if (enemy22_pos.y + 7 >= (HEIGHT-1) ) { // bottom pixel is 47
RexRoshan 0:99fa5a619081 417 // hit bottom
RexRoshan 0:99fa5a619081 418 enemy22_pos.y = (HEIGHT-1) - 7; // stops ball going off screen
RexRoshan 0:99fa5a619081 419 enemy22_movement.y = -enemy22_movement.y;
RexRoshan 0:99fa5a619081 420 // audio feedback
RexRoshan 0:99fa5a619081 421 } else if (enemy22_pos.y <= 1) { // 1 due to 1 pixel boundary
RexRoshan 0:99fa5a619081 422 enemy22_pos.y = 1; // bounce off ceiling without going off screen
RexRoshan 0:99fa5a619081 423 enemy22_movement.y = -enemy22_movement.y;
RexRoshan 0:99fa5a619081 424 }
RexRoshan 0:99fa5a619081 425
RexRoshan 0:99fa5a619081 426 // update ball parameters
RexRoshan 0:99fa5a619081 427 _e21.set_movement(enemy21_movement);
RexRoshan 0:99fa5a619081 428 _e22.set_movement(enemy22_movement);
RexRoshan 0:99fa5a619081 429 _e21.set_enemy21_pos(enemy21_pos);
RexRoshan 0:99fa5a619081 430 _e22.set_enemy22_pos(enemy22_pos);
RexRoshan 0:99fa5a619081 431 }
RexRoshan 0:99fa5a619081 432 void GameEngine::enemy_dead(N5110 &lcd, Gamepad &pad){
RexRoshan 0:99fa5a619081 433 int e1_health = _e1.get_health();
RexRoshan 0:99fa5a619081 434 Vector2D e1_pos = _e1.get_enemy_pos();
RexRoshan 0:99fa5a619081 435 if (e1_health == 10){
RexRoshan 0:99fa5a619081 436 lcd.drawSprite(e1_pos.x-10,e1_pos.y-10,23,23,(int *)explosion);
RexRoshan 0:99fa5a619081 437 pad.tone(1000.0,0.5);
RexRoshan 0:99fa5a619081 438 pad.tone(800.0,0.5);
RexRoshan 0:99fa5a619081 439 pad.tone(600.0,0.5);
RexRoshan 0:99fa5a619081 440 pad.tone(400.0,0.5);
RexRoshan 0:99fa5a619081 441 // lcd.refresh();
RexRoshan 0:99fa5a619081 442 wait(0.5);
RexRoshan 0:99fa5a619081 443 lcd.drawSprite(e1_pos.x-10,e1_pos.y-10,23,23,(int *)explosion);
RexRoshan 0:99fa5a619081 444 _e1.update();
RexRoshan 0:99fa5a619081 445 // wait(2.0);
RexRoshan 0:99fa5a619081 446 _stage = 2;
RexRoshan 0:99fa5a619081 447 _e1.add_health();
RexRoshan 0:99fa5a619081 448 lcd.refresh();
RexRoshan 0:99fa5a619081 449 }
RexRoshan 0:99fa5a619081 450
RexRoshan 0:99fa5a619081 451 }
RexRoshan 0:99fa5a619081 452
RexRoshan 0:99fa5a619081 453 void GameEngine::enemy2_dead(N5110 &lcd, Gamepad &pad){
RexRoshan 0:99fa5a619081 454
RexRoshan 0:99fa5a619081 455 int e21_health = _e21.get_health();
RexRoshan 0:99fa5a619081 456 int e22_health = _e22.get_health();
RexRoshan 0:99fa5a619081 457
RexRoshan 0:99fa5a619081 458 Vector2D e21_pos = _e21.get_enemy21_pos();
RexRoshan 0:99fa5a619081 459 Vector2D e22_pos = _e22.get_enemy22_pos();
RexRoshan 0:99fa5a619081 460
RexRoshan 0:99fa5a619081 461 if ((e21_health >= 10) && (e22_health >= 10)){
RexRoshan 0:99fa5a619081 462 lcd.drawSprite(e21_pos.x-10,e21_pos.y-10,23,23,(int *)explosion);
RexRoshan 0:99fa5a619081 463 lcd.drawSprite(e22_pos.x-10,e22_pos.y-10,23,23,(int *)explosion);
RexRoshan 0:99fa5a619081 464 pad.tone(1000.0,0.5);
RexRoshan 0:99fa5a619081 465 pad.tone(800.0,0.5);
RexRoshan 0:99fa5a619081 466 pad.tone(600.0,0.5);
RexRoshan 0:99fa5a619081 467 pad.tone(400.0,0.5);
RexRoshan 0:99fa5a619081 468 // lcd.refresh();
RexRoshan 0:99fa5a619081 469 wait(0.2);
RexRoshan 0:99fa5a619081 470 lcd.drawSprite(e21_pos.x-10,e21_pos.y-10,23,23,(int *)explosion);
RexRoshan 0:99fa5a619081 471 lcd.drawSprite(e22_pos.x-10,e22_pos.y-10,23,23,(int *)explosion);
RexRoshan 0:99fa5a619081 472 _stage = 4;
RexRoshan 0:99fa5a619081 473 _e21.add_health();
RexRoshan 0:99fa5a619081 474 _e22.add_health();
RexRoshan 0:99fa5a619081 475 lcd.refresh();
RexRoshan 0:99fa5a619081 476 }
RexRoshan 0:99fa5a619081 477
RexRoshan 0:99fa5a619081 478 }
RexRoshan 0:99fa5a619081 479 void GameEngine::spacecraft_dead(N5110 &lcd, Gamepad &pad)
RexRoshan 0:99fa5a619081 480 {
RexRoshan 0:99fa5a619081 481
RexRoshan 0:99fa5a619081 482 int p1_health = _p1.get_health();
RexRoshan 0:99fa5a619081 483 Vector2D p1_pos = _p1.get_pos();
RexRoshan 0:99fa5a619081 484
RexRoshan 0:99fa5a619081 485 if (p1_health == 6){
RexRoshan 0:99fa5a619081 486
RexRoshan 0:99fa5a619081 487 lcd.drawSprite(p1_pos.x-5,p1_pos.y-7,23,23,(int *)explosion);
RexRoshan 0:99fa5a619081 488 pad.tone(1000.0,0.5);
RexRoshan 0:99fa5a619081 489 pad.tone(800.0,0.5);
RexRoshan 0:99fa5a619081 490 pad.tone(600.0,0.5);
RexRoshan 0:99fa5a619081 491 pad.tone(400.0,0.5);
RexRoshan 0:99fa5a619081 492 wait(0.5);
RexRoshan 0:99fa5a619081 493 lcd.refresh();
RexRoshan 0:99fa5a619081 494 wait(0.1);
RexRoshan 0:99fa5a619081 495 lcd.drawSprite(p1_pos.x-5,p1_pos.y-7,23,23,(int *)explosion);
RexRoshan 0:99fa5a619081 496 _p1.update_move();
RexRoshan 0:99fa5a619081 497 // wait(2.0);
RexRoshan 0:99fa5a619081 498 _stage = 1;
RexRoshan 0:99fa5a619081 499 _p1.add_health();
RexRoshan 0:99fa5a619081 500 lcd.refresh();
RexRoshan 0:99fa5a619081 501 }
RexRoshan 0:99fa5a619081 502
RexRoshan 0:99fa5a619081 503 }
RexRoshan 0:99fa5a619081 504
RexRoshan 0:99fa5a619081 505 void GameEngine::spacecraft2_dead(N5110 &lcd, Gamepad &pad)
RexRoshan 0:99fa5a619081 506 {
RexRoshan 0:99fa5a619081 507
RexRoshan 0:99fa5a619081 508 int p1_health = _p1.get_health();
RexRoshan 0:99fa5a619081 509 Vector2D p1_pos = _p1.get_pos();
RexRoshan 0:99fa5a619081 510
RexRoshan 0:99fa5a619081 511 if (p1_health == 6){
RexRoshan 0:99fa5a619081 512
RexRoshan 0:99fa5a619081 513 lcd.drawSprite(p1_pos.x-5,p1_pos.y-7,23,23,(int *)explosion);
RexRoshan 0:99fa5a619081 514 pad.tone(1000.0,0.5);
RexRoshan 0:99fa5a619081 515 pad.tone(800.0,0.5);
RexRoshan 0:99fa5a619081 516 pad.tone(600.0,0.5);
RexRoshan 0:99fa5a619081 517 pad.tone(400.0,0.5);
RexRoshan 0:99fa5a619081 518 wait(0.5);
RexRoshan 0:99fa5a619081 519 lcd.refresh();
RexRoshan 0:99fa5a619081 520 wait(0.1);
RexRoshan 0:99fa5a619081 521 lcd.drawSprite(p1_pos.x-5,p1_pos.y-7,23,23,(int *)explosion);
RexRoshan 0:99fa5a619081 522 _p1.update_move();
RexRoshan 0:99fa5a619081 523 // wait(2.0);
RexRoshan 0:99fa5a619081 524 _stage = 3;
RexRoshan 0:99fa5a619081 525 _p1.add_health();
RexRoshan 0:99fa5a619081 526 lcd.refresh();
RexRoshan 0:99fa5a619081 527 }
RexRoshan 0:99fa5a619081 528
RexRoshan 0:99fa5a619081 529 }
RexRoshan 0:99fa5a619081 530 void GameEngine::check_mission_one(Gamepad &pad){
RexRoshan 0:99fa5a619081 531
RexRoshan 0:99fa5a619081 532 if (_stage == 1){
RexRoshan 0:99fa5a619081 533 pad.tone(233.0,0.5);
RexRoshan 0:99fa5a619081 534 wait(0.5);
RexRoshan 0:99fa5a619081 535 pad.tone(184.0,0.5);
RexRoshan 0:99fa5a619081 536 wait(0.5);
RexRoshan 0:99fa5a619081 537 pad.tone(174.0,2.0);
RexRoshan 0:99fa5a619081 538 wait(1.0);
RexRoshan 0:99fa5a619081 539 } else if (_stage == 2){
RexRoshan 0:99fa5a619081 540
RexRoshan 0:99fa5a619081 541 pad.leds_off();
RexRoshan 0:99fa5a619081 542 pad.tone(184.0,0.2);
RexRoshan 0:99fa5a619081 543 wait(0.5);
RexRoshan 0:99fa5a619081 544 pad.tone(233.0,0.2);
RexRoshan 0:99fa5a619081 545 wait(0.5);
RexRoshan 0:99fa5a619081 546 pad.tone(184.0,0.2);
RexRoshan 0:99fa5a619081 547 wait(0.5);
RexRoshan 0:99fa5a619081 548 pad.tone(233.0,0.2);
RexRoshan 0:99fa5a619081 549 wait(0.5);
RexRoshan 0:99fa5a619081 550 pad.tone(184.0,0.2);
RexRoshan 0:99fa5a619081 551 wait(0.5);
RexRoshan 0:99fa5a619081 552 pad.tone(233.0,0.2);
RexRoshan 0:99fa5a619081 553 wait(0.5);
RexRoshan 0:99fa5a619081 554 pad.tone(184.0,2.0);
RexRoshan 0:99fa5a619081 555 wait(0.5);
RexRoshan 0:99fa5a619081 556 }
RexRoshan 0:99fa5a619081 557 }
RexRoshan 0:99fa5a619081 558
RexRoshan 0:99fa5a619081 559 void GameEngine::check_mission_two(Gamepad &pad){
RexRoshan 0:99fa5a619081 560
RexRoshan 0:99fa5a619081 561 if (_stage == 3){
RexRoshan 0:99fa5a619081 562 pad.tone(233.0,0.5);
RexRoshan 0:99fa5a619081 563 wait(0.5);
RexRoshan 0:99fa5a619081 564 pad.tone(184.0,0.5);
RexRoshan 0:99fa5a619081 565 wait(0.5);
RexRoshan 0:99fa5a619081 566 pad.tone(174.0,2.0);
RexRoshan 0:99fa5a619081 567 wait(1.0);
RexRoshan 0:99fa5a619081 568 } else if (_stage == 4){
RexRoshan 0:99fa5a619081 569
RexRoshan 0:99fa5a619081 570 pad.leds_off();
RexRoshan 0:99fa5a619081 571 pad.tone(184.0,0.2);
RexRoshan 0:99fa5a619081 572 wait(0.5);
RexRoshan 0:99fa5a619081 573 pad.tone(233.0,0.2);
RexRoshan 0:99fa5a619081 574 wait(0.5);
RexRoshan 0:99fa5a619081 575 pad.tone(184.0,0.2);
RexRoshan 0:99fa5a619081 576 wait(0.5);
RexRoshan 0:99fa5a619081 577 pad.tone(233.0,0.2);
RexRoshan 0:99fa5a619081 578 wait(0.5);
RexRoshan 0:99fa5a619081 579 pad.tone(184.0,0.2);
RexRoshan 0:99fa5a619081 580 wait(0.5);
RexRoshan 0:99fa5a619081 581 pad.tone(233.0,0.2);
RexRoshan 0:99fa5a619081 582 wait(0.5);
RexRoshan 0:99fa5a619081 583 pad.tone(184.0,2.0);
RexRoshan 0:99fa5a619081 584 wait(0.5);
RexRoshan 0:99fa5a619081 585 }
RexRoshan 0:99fa5a619081 586 }
RexRoshan 0:99fa5a619081 587 //void GameEngine::mission_one_complete(N5110 &lcd){
RexRoshan 0:99fa5a619081 588
RexRoshan 0:99fa5a619081 589 // if (_stage_two == true){
RexRoshan 0:99fa5a619081 590 // lcd.clear();
RexRoshan 0:99fa5a619081 591 // lcd.drawSprite(0,0,48,84,(int *)mission_one);
RexRoshan 0:99fa5a619081 592 // lcd.refresh();
RexRoshan 0:99fa5a619081 593 // }
RexRoshan 0:99fa5a619081 594
RexRoshan 0:99fa5a619081 595 //}
RexRoshan 0:99fa5a619081 596
RexRoshan 0:99fa5a619081 597 //void GameEngine::mission_one_fail(N5110 &lcd,Gamepad &pad)
RexRoshan 0:99fa5a619081 598 //{
RexRoshan 0:99fa5a619081 599 // if (_stage_one == true){
RexRoshan 0:99fa5a619081 600 // lcd.clear();
RexRoshan 0:99fa5a619081 601 // lcd.drawSprite(6,5,42,73,(int *)mission_one_failure);
RexRoshan 0:99fa5a619081 602 // lcd.refresh();
RexRoshan 0:99fa5a619081 603 // if (pad.check_event(Gamepad::B_PRESSED)){
RexRoshan 0:99fa5a619081 604 // lcd.init();
RexRoshan 0:99fa5a619081 605 // pad.init();
RexRoshan 0:99fa5a619081 606 // }
RexRoshan 0:99fa5a619081 607 // }
RexRoshan 0:99fa5a619081 608 //}
RexRoshan 0:99fa5a619081 609
RexRoshan 0:99fa5a619081 610 void GameEngine::draw_enemy_health(N5110 &lcd)
RexRoshan 0:99fa5a619081 611 {
RexRoshan 0:99fa5a619081 612 // get health of the enemy
RexRoshan 0:99fa5a619081 613 int e1_health = _e1.get_health();
RexRoshan 0:99fa5a619081 614
RexRoshan 0:99fa5a619081 615 lcd.drawRect(56,40,20,4,FILL_TRANSPARENT);
RexRoshan 0:99fa5a619081 616 lcd.drawRect(56,40,20-2*e1_health,4,FILL_BLACK);
RexRoshan 0:99fa5a619081 617
RexRoshan 0:99fa5a619081 618
RexRoshan 0:99fa5a619081 619
RexRoshan 0:99fa5a619081 620 }
RexRoshan 0:99fa5a619081 621
RexRoshan 0:99fa5a619081 622 void GameEngine::draw_enemy21_health(N5110 &lcd)
RexRoshan 0:99fa5a619081 623 {
RexRoshan 0:99fa5a619081 624 // get health of the enemy
RexRoshan 0:99fa5a619081 625 int e21_health = _e21.get_health();
RexRoshan 0:99fa5a619081 626
RexRoshan 0:99fa5a619081 627 if (e21_health < 10){
RexRoshan 0:99fa5a619081 628 lcd.drawRect(60,22,20,4,FILL_TRANSPARENT);
RexRoshan 0:99fa5a619081 629 lcd.drawRect(60,22,20-2*e21_health,4,FILL_BLACK);
RexRoshan 0:99fa5a619081 630 }
RexRoshan 0:99fa5a619081 631 else {
RexRoshan 0:99fa5a619081 632 lcd.drawRect(60,22,20,4,FILL_TRANSPARENT);
RexRoshan 0:99fa5a619081 633 }
RexRoshan 0:99fa5a619081 634 }
RexRoshan 0:99fa5a619081 635
RexRoshan 0:99fa5a619081 636 void GameEngine::draw_enemy22_health(N5110 &lcd)
RexRoshan 0:99fa5a619081 637 {
RexRoshan 0:99fa5a619081 638 // get health of the enemy
RexRoshan 0:99fa5a619081 639 int e22_health = _e22.get_health();
RexRoshan 0:99fa5a619081 640
RexRoshan 0:99fa5a619081 641 if (e22_health < 10){
RexRoshan 0:99fa5a619081 642 lcd.drawRect(60,28,20,4,FILL_TRANSPARENT);
RexRoshan 0:99fa5a619081 643 lcd.drawRect(60,28,20-2*e22_health,4,FILL_BLACK);
RexRoshan 0:99fa5a619081 644 }
RexRoshan 0:99fa5a619081 645 else {
RexRoshan 0:99fa5a619081 646 lcd.drawRect(60,28,20,4,FILL_TRANSPARENT);
RexRoshan 0:99fa5a619081 647 }
RexRoshan 0:99fa5a619081 648
RexRoshan 0:99fa5a619081 649 }
RexRoshan 0:99fa5a619081 650
RexRoshan 0:99fa5a619081 651 void GameEngine::draw_spacecraft_health(Gamepad &pad)
RexRoshan 0:99fa5a619081 652 {
RexRoshan 0:99fa5a619081 653 //get the health of the spacecraft
RexRoshan 0:99fa5a619081 654 int p1_health = _p1.get_health();
RexRoshan 0:99fa5a619081 655
RexRoshan 0:99fa5a619081 656 if (p1_health == 0){
RexRoshan 0:99fa5a619081 657 pad.leds_on();
RexRoshan 0:99fa5a619081 658 }else if (p1_health == 1){
RexRoshan 0:99fa5a619081 659 pad.led(1,0);
RexRoshan 0:99fa5a619081 660 pad.led(2,1);
RexRoshan 0:99fa5a619081 661 pad.led(3,1);
RexRoshan 0:99fa5a619081 662 pad.led(4,1);
RexRoshan 0:99fa5a619081 663 pad.led(5,1);
RexRoshan 0:99fa5a619081 664 pad.led(6,1);
RexRoshan 0:99fa5a619081 665
RexRoshan 0:99fa5a619081 666 }else if (p1_health == 2){
RexRoshan 0:99fa5a619081 667 pad.led(1,0);
RexRoshan 0:99fa5a619081 668 pad.led(2,0);
RexRoshan 0:99fa5a619081 669 pad.led(3,1);
RexRoshan 0:99fa5a619081 670 pad.led(4,1);
RexRoshan 0:99fa5a619081 671 pad.led(5,1);
RexRoshan 0:99fa5a619081 672 pad.led(6,1);
RexRoshan 0:99fa5a619081 673 }else if (p1_health == 3){
RexRoshan 0:99fa5a619081 674 pad.led(1,0);
RexRoshan 0:99fa5a619081 675 pad.led(2,0);
RexRoshan 0:99fa5a619081 676 pad.led(3,0);
RexRoshan 0:99fa5a619081 677 pad.led(4,1);
RexRoshan 0:99fa5a619081 678 pad.led(5,1);
RexRoshan 0:99fa5a619081 679 pad.led(6,1);
RexRoshan 0:99fa5a619081 680
RexRoshan 0:99fa5a619081 681 }else if (p1_health == 4){
RexRoshan 0:99fa5a619081 682 pad.led(1,0);
RexRoshan 0:99fa5a619081 683 pad.led(2,0);
RexRoshan 0:99fa5a619081 684 pad.led(3,0);
RexRoshan 0:99fa5a619081 685 pad.led(4,0);
RexRoshan 0:99fa5a619081 686 pad.led(5,1);
RexRoshan 0:99fa5a619081 687 pad.led(6,1);
RexRoshan 0:99fa5a619081 688
RexRoshan 0:99fa5a619081 689 }else if (p1_health == 5){
RexRoshan 0:99fa5a619081 690 pad.led(1,0);
RexRoshan 0:99fa5a619081 691 pad.led(2,0);
RexRoshan 0:99fa5a619081 692 pad.led(3,0);
RexRoshan 0:99fa5a619081 693 pad.led(4,0);
RexRoshan 0:99fa5a619081 694 pad.led(5,0);
RexRoshan 0:99fa5a619081 695 pad.led(6,1);
RexRoshan 0:99fa5a619081 696
RexRoshan 0:99fa5a619081 697 } else {
RexRoshan 0:99fa5a619081 698 pad.leds_off();
RexRoshan 0:99fa5a619081 699 }
RexRoshan 0:99fa5a619081 700
RexRoshan 0:99fa5a619081 701 }
RexRoshan 0:99fa5a619081 702
RexRoshan 0:99fa5a619081 703 int GameEngine::get_game_stage() {
RexRoshan 0:99fa5a619081 704 int stage = _stage;
RexRoshan 0:99fa5a619081 705 return stage;
RexRoshan 0:99fa5a619081 706 }
RexRoshan 0:99fa5a619081 707
RexRoshan 0:99fa5a619081 708 int GameEngine::restart_game_stage() {
RexRoshan 0:99fa5a619081 709 int stage = _stage;
RexRoshan 0:99fa5a619081 710
RexRoshan 0:99fa5a619081 711 stage = 0;
RexRoshan 0:99fa5a619081 712 return stage;
RexRoshan 0:99fa5a619081 713 }