Basic game using accelerometer and LCD screen. You can move and dodge asteroids coming from both left and right. There is no scoring at the moment.

Dependencies:   C12832 FXOS8700Q mbed-rtos mbed

Asteroid.h

Committer:
co838_gtvl2
Date:
2016-02-17
Revision:
2:9e0c826103d7
Parent:
1:c6734b909bf0

File content as of revision 2:9e0c826103d7:

#ifndef _ASTEROID_H_
# define _ASTEROID_H_

# include "main.h"
# include "Player.h"

class Asteroid
{
public:
    Asteroid();
    ~Asteroid();
    int                 getX() const;
    int                 getY() const;
    bool                move(Player*);
private:
    char                inc;    // -1 / +1
    unsigned short int  x;      // 127 => 0 / 0 => 127
    float               a;      // [A] * x + b
    unsigned short int  b;      // a * x + [B]
};

#endif /* _ASTEROID_H_ */