ELEC2645 (2018/19) / Mbed 2 deprecated fy14lkaa

Dependencies:   mbed

SpaceInvadersEngine/SpaceInvadersEngine.h

Committer:
fy14lkaa
Date:
2019-04-28
Revision:
82:fdae28b01415
Parent:
73:bac5c72f7588
Child:
92:8a1b14488ca5

File content as of revision 82:fdae28b01415:

#ifndef SPACEINVADERSENGINE_H
#define SPACEINVADERSENGINE_H

#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
#include "Alien.h"
#include "bullet.h"
#include "space_ship.h"




// gap from edge of screen
#define GAP 2


class SpaceInvadersEngine
{

public:
    SpaceInvadersEngine();
    ~SpaceInvadersEngine();

    void init(int space_ship_width,int space_ship_height,int bullet_size, int Alien_size,int speed);
    void read_input(Gamepad &pad);
    void update(Gamepad &pad);
    void draw(N5110 &lcd);



private:


    void check_Alien_collision(Gamepad &pad);
    void space_ship_collisions(Gamepad &pad);
    void check_goal(Gamepad &pad);
    void print_scores(N5110 &lcd);



    // Alien _A1;
    int _space_shipx;
    int _space_ship_width;
    int _space_ship_height;
    int _bullet_size;
    int _Alien_size;
    int _speed;

    Direction _d;
    float _mag;



};

#endif