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
Levelengine/Levelengine.h
- Committer:
- el17arm
- Date:
- 2019-04-09
- Revision:
- 26:bce40bf4c9fc
- Parent:
- 24:9c7aca60e374
- Child:
- 27:e73dd64ef334
File content as of revision 26:bce40bf4c9fc:
#ifndef Levelengine_H
#define Levelengine_H
#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
#include "Minerengine.h"
const int solid_block[9] = {
1,1,1,
1,0,1,
1,1,1,
};
const int key[12] = {
1,1,0,0,
1,0,1,1,
1,1,0,1,
};
const int key_collected[12] = {
0,0,0,0,
0,0,0,0,
0,0,0,0,
};
const int spike[9] = {
1,1,1,
0,1,0,
1,1,1,
};
const int door[30] = {
1,1,1,1,1,
1,0,1,0,1,
1,1,0,1,1,
1,0,1,0,1,
1,1,0,1,1,
1,0,1,0,1,
};
const int enemy[15] = {
1,1,1,
1,0,1,
1,1,1,
0,1,0,
1,1,1,
};
typedef struct {
bool key[5];
} Key;
class Levelengine
{
public:
Levelengine();
~Levelengine();
void soft_blocks(int x, int y, N5110 &lcd);
void draw_solid_block(int x, int y, N5110 &lcd);
void key_collect(int k, int x, int y, N5110 &lcd, Gamepad &pad);
int keys_collected();
bool trap(int x, int y, N5110 &lcd);
bool exit_level(int x, int y, N5110 &lcd);
void enemy_move(int x, int y, N5110 &lcd);
Key _k;
private:
int _collision;
bool key_collect1; //ensures loop is only executed once and key does not reappear
bool key_collect2;
bool key_collect3;
bool key_collect4;
bool key_collect5;
int _keys;
Minerengine _miner;
};
#endif