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
Diff: Sprites/Sprites.h
- Revision:
- 40:913339e324b8
- Parent:
- 38:55bb9da08a52
- Child:
- 41:0cf320f73424
--- a/Sprites/Sprites.h Sun Apr 14 15:18:58 2019 +0000 +++ b/Sprites/Sprites.h Mon Apr 15 02:01:41 2019 +0000 @@ -4,6 +4,7 @@ #include "mbed.h" #include "N5110.h" #include "Gamepad.h" +//#include "rtos.h" const int miner_right[24] = { 1,1,1, @@ -82,37 +83,51 @@ double ky[5]; }; +struct enemies_init { + bool eflag[5]; + double ex[5]; + double ey[5]; + int counter[5]; + int distance[5]; +}; + + ////////structs for populating levels////////////////// struct Enemies { - bool eflag; - double ex; - double ey; - int counter; - int distance; + bool f[5]; + double ex[5]; + double ey[5]; + int c[5]; + int d[5]; + double v[5]; }; struct Traps { - double tx; - double ty; + double tx[5]; + double ty[5]; }; struct Keys { - bool k; - double kx; - double ky; + double kx[5]; + double ky[5]; }; struct Solid_blocks { - double bx; - double by; + double bx[5]; + double by[5]; }; struct Soft_blocks { - double sx; - double sy; - int sz; + double sx[5]; + double sy[5]; + int sz[5]; +}; + +struct Level_exit { + double lx[5]; + double ly[5]; }; class Sprites @@ -124,7 +139,7 @@ ~Sprites(); void miner_init(int x, int y); - void miner_move(Direction d, N5110 &lcd); + int miner_move(Direction d, N5110 &lcd); void miner_draw(N5110 &lcd); void miner_gravity(N5110 &lcd); int miner_jump(N5110 &lcd, Gamepad &pad); @@ -135,7 +150,7 @@ bool enemy_collision(int i); void key_collect(int k, int x, int y, N5110 &lcd, Gamepad &pad); - bool keys_collected(); + int keys_collected(); bool exit_level(int x, int y, N5110 &lcd); @@ -171,9 +186,8 @@ double kx[5]; double ky[5]; - int _enem_flag; + enemies_init _enem; - }; #endif \ No newline at end of file