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:
- 34:c5a042973e0c
- Parent:
- 33:023f57d52b1c
- Child:
- 35:b7a0f0b363d0
- Child:
- 36:203ec93b4cc7
--- a/Sprites/Sprites.h Wed Apr 10 17:56:13 2019 +0000 +++ b/Sprites/Sprites.h Thu Apr 11 21:29:48 2019 +0000 @@ -52,16 +52,17 @@ const int spike[9] = { - 1,1,1, + 1,0,1, 0,1,0, - 1,1,1, + 1,0,1, }; -const int solid_block[9] = { +const int solid_block[18] = { - 1,1,1, - 1,0,1, - 1,1,1, + 1,1,1,1,1,1, + 1,0,1,1,0,1, + 1,1,1,1,1,1, + }; const int door[30] = { @@ -80,10 +81,20 @@ double ey[5]; int counter[5]; int distance[5]; + + }; -struct Key{ +struct keyed { bool key[5]; + double kx[5]; + double ky[5]; +}; + +struct trap_str { + bool trap[5]; + double tx[5]; + double ty[5]; }; class Sprites @@ -110,8 +121,8 @@ bool exit_level(int x, int y, N5110 &lcd); - bool trap(int x, int y, N5110 &lcd); - void draw_solid_block(int x, int y, N5110 &lcd); + bool trap(int t, int x, int y, N5110 &lcd); + void blocks(int b, int x, int y, N5110 &lcd); void soft_blocks(int x, int y, N5110 &lcd); Vector2D get_pos(); @@ -126,9 +137,15 @@ bool _j_flag; int _j_counter; - Key _k; + bool block[5]; + double bx[5]; + double by[5]; + + keyed _k; int _keys; + bool _collision; + trap_str _trap; enemies _enem; };