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 MotionSensor
Diff: Entity/Walls/Walls.cpp
- Revision:
- 41:0697508a28ba
- Parent:
- 40:cbcbf6fc1421
- Child:
- 57:1c12361b6e3d
--- a/Entity/Walls/Walls.cpp Tue May 07 12:42:12 2019 +0000
+++ b/Entity/Walls/Walls.cpp Tue May 07 17:02:30 2019 +0000
@@ -1,45 +1,32 @@
-//#include "Walls.h"
-//Walls::Walls(float pos_x, float pos_y)
-//{
-// hp = 1;
-//
-// hitbox.width = 19;
-// hitbox.height = 9;
-//
-// sprite_size.width = 21;
-// sprite_size.height = 23;
-// sprite_size.offset_x = -1;
-// sprite_size.offset_y = -14;
-//
-// _shadow.width = 19;
-// _shadow.height = 5;
-// _shadow.offset_x = 0;
-// _shadow.offset_y = 5;
-//
-// position.x = pos_x;
-// position.y = pos_y;
-// update_prev_pos();
-//
-// frame.count = 0;
-// frame.number = 0;
-// frame.max = 2;
-// face = 2;
-//
-// velocity = 0.2;
-// _hp_drop_chance = 100;
-//}
-//
-//void move(float unused, float unused1, char * unused2, bool * unused3) // movement control and miscellaneous updates
-//{
-// ;
-//}
-//
-//void take_damage(int damage)
-//{
-//
-//}
-//
-//void draw(N5110 &lcd)
-//{
-//
-//}
\ No newline at end of file
+#include "Walls.h"
+Walls::Walls(int pos_x, int pos_y, int hitbox_width, int hitbox_height)
+{
+ hitbox.width = hitbox_width;
+ hitbox.height = hitbox_height;
+
+ sprite_size.width = hitbox_width;
+ sprite_size.height = hitbox_height + 7;
+ sprite_size.offset_x = 0;
+ sprite_size.offset_y = -7;
+
+ position.x = pos_x;
+ position.y = pos_y;
+ update_prev_pos();
+}
+
+void Walls::move(float unused, float unused1, char * unused2, bool * unused3) // movement control and miscellaneous updates
+{
+
+}
+
+void Walls::take_damage(int damage)
+{
+
+}
+
+void Walls::draw(N5110 &lcd)
+{
+ lcd.drawRect(position.x, position.y + sprite_size.offset_y, sprite_size.width, sprite_size.height, FILL_BLACK);
+ lcd.drawRect(position.x+1, position.y + sprite_size.offset_y+1, sprite_size.width-2, sprite_size.height-2, FILL_WHITE);
+ lcd.drawLine(position.x, position.y + sprite_size.offset_y + hitbox.height - 1, position.x + hitbox.width - 1, position.y + sprite_size.offset_y + hitbox.height - 1, 1);
+}
\ No newline at end of file