Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Enemy/Enemy1.h
- Committer:
- S_Tingle
- Date:
- 2019-05-09
- Revision:
- 22:8e38efeae0c9
- Parent:
- 21:7d4827af00d6
- Child:
- 25:1d3bf74dddeb
File content as of revision 22:8e38efeae0c9:
#ifndef ENEMY1_H
#define ENEMY1_H
#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
const int enemy_A[7][7] = {
{0,0,1,1,1,1,1},
{0,0,0,0,0,0,1},
{0,0,0,0,0,0,1},
{1,1,1,1,1,1,1},
{1,0,0,0,0,0,1},
{1,0,0,0,0,0,1},
{1,1,1,1,1,1,1}
};
const int enemy_1[7][7] = {
{1,1,1,1,0,0,0},
{0,0,0,1,0,0,0},
{0,0,0,1,0,0,0},
{0,0,0,1,0,0,0},
{0,0,0,1,0,0,0},
{0,0,0,1,0,0,0},
{1,1,1,1,1,1,1}
};
class Enemy1{
public:
Enemy1();
~Enemy1();
void init(int x,int y);
int get_x_enem();
int get_y_enem();
void drawSpriteA(N5110 &lcd);
void drawSprite1(N5110 &lcd);
void movementA(N5110 &lcd);
void movement1(N5110 &lcd);
bool northCollision(int x, int y, N5110 &lcd);
bool southCollision(int x, int y, N5110 &lcd);
bool eastCollision(int x, int y, N5110 &lcd);
bool westCollision(int x, int y, N5110 &lcd);
bool collidePlayer(int x, int y, Gamepad &pad);
private:
int x_enem;
int y_enem;
int accel;
int _incrementer_enem1;
};
#endif