feat(shield): added shields

This commit is contained in:
2024-01-23 11:40:46 +01:00
parent 15c745d7c0
commit d67394aaec
10 changed files with 127 additions and 10 deletions
+13
View File
@@ -0,0 +1,13 @@
#include "Shield.h"
Shield::Shield(Window& window) {
int shapeWidth = window.getSize().x / 10;
int shapeHeight = window.getSize().y / 35;
_shape = RectangleShape(Vector2f(shapeWidth, shapeHeight));
_shape.setFillColor(Color(Color(52, 252, 5)));
}
void Shield::setPosition(Vector2f position) {
_shape.setPosition(position.x + _shape.getSize().x, position.y - _shape.getScale().y);
}