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-10
- Revision:
- 29:d85886364643
- Parent:
- 27:e73dd64ef334
- Child:
- 31:ed5f7f15a1ed
File content as of revision 29:d85886364643:
#ifndef Levelengine_H
#define Levelengine_H
#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
#include "Miner.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,
};
struct Key{
bool key[5];
};
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);
private:
int _collision;
int _keys;
Miner _miner;
Direction _d;
Key _k;
};
#endif