diff options
author | salaaad2 <arthurdurant263@gmail.com> | 2022-01-14 16:40:11 +0100 |
---|---|---|
committer | salaaad2 <arthurdurant263@gmail.com> | 2022-01-14 16:40:11 +0100 |
commit | 7a0ec30b5444b9f07ddeaa6943edaf5bd02e0349 (patch) | |
tree | a85c1a47e1f41c6c6530f3fe3cb6ce66a2ea61c7 /src/wp_enemyslingshot.cpp | |
parent | strange behavior... I WILL find out whats going on ! (diff) | |
download | threshold-7a0ec30b5444b9f07ddeaa6943edaf5bd02e0349.tar.gz threshold-7a0ec30b5444b9f07ddeaa6943edaf5bd02e0349.tar.bz2 threshold-7a0ec30b5444b9f07ddeaa6943edaf5bd02e0349.tar.xz threshold-7a0ec30b5444b9f07ddeaa6943edaf5bd02e0349.tar.zst threshold-7a0ec30b5444b9f07ddeaa6943edaf5bd02e0349.zip |
enemy slingshot is functional
Diffstat (limited to '')
-rw-r--r-- | src/wp_enemyslingshot.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/wp_enemyslingshot.cpp b/src/wp_enemyslingshot.cpp index ad113e8..068f404 100644 --- a/src/wp_enemyslingshot.cpp +++ b/src/wp_enemyslingshot.cpp @@ -8,22 +8,22 @@ #include "gameplay.hpp" wp_enemysling::wp_enemysling(const char* s, const char* r) - : AWeapon(300.0f, 10, 1, 0.0, s, r, "sling") {} + : AWeapon(300.0f, 10, 10, 0.0, s, r, "sling") {} int wp_enemysling::bang(std::vector<Entity>* enemies, Entity* baddie) { if (barrel == 0) { return (1); } else { barrel--; - PlaySound(shot); t = GetTime(); // enemysling spawns a new enemy every @reload seconds. thats it. // it's a slingshot // Entity en(1); - en.posX = 0; - en.posY = 0; - en.direction = (Vector2){1.0f, 1.0f}; + en.posX = baddie->posX + 10; + en.posY = baddie->posY + 10; + en.direction.x = baddie->direction.x * 2.0f; + en.direction.y = baddie->direction.y * 2.0f; en.radius = 20; en.currentWeapon = nullptr; en.idleTex = LoadTexture(SBIRE_TEX_IDLE); |