diff options
author | salaaad2 <arthurdurant263@gmail.com> | 2022-01-22 07:39:54 +0100 |
---|---|---|
committer | salaaad2 <arthurdurant263@gmail.com> | 2022-01-22 07:39:54 +0100 |
commit | aa872f4f35890027e65c930cc9cc603b5db22906 (patch) | |
tree | 48b53e75fd8ed0ac7bea62c73ddd85975cc47f43 /src/wp_nadelauncher.cpp | |
parent | Parsing: the great rework (tm) finally works as intended (diff) | |
download | threshold-aa872f4f35890027e65c930cc9cc603b5db22906.tar.gz threshold-aa872f4f35890027e65c930cc9cc603b5db22906.tar.bz2 threshold-aa872f4f35890027e65c930cc9cc603b5db22906.tar.xz threshold-aa872f4f35890027e65c930cc9cc603b5db22906.tar.zst threshold-aa872f4f35890027e65c930cc9cc603b5db22906.zip |
Weapons: amazing job adding another weapon salade ! outstanding
Diffstat (limited to 'src/wp_nadelauncher.cpp')
-rw-r--r-- | src/wp_nadelauncher.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/wp_nadelauncher.cpp b/src/wp_nadelauncher.cpp new file mode 100644 index 0000000..7352b42 --- /dev/null +++ b/src/wp_nadelauncher.cpp @@ -0,0 +1,39 @@ +#include "wp_nadelauncher.hpp" + +#include <raylib.h> +#include <raymath.h> +#include <iostream> + +#include "entity.hpp" +#include "projectile.hpp" + +wp_nadelauncher::wp_nadelauncher(const char* s, const char* r) + : AWeapon(300.0f, 1, 30, 0.0, s, r, "nade", true) {} + +int wp_nadelauncher::bang(std::vector<Entity>* enemies, Entity* player) { + if (barrel == 0) { + return (1); + } else { + Projectile* proj = new Projectile(); + proj->dir = player->direction; + proj->radius = player->radius; + proj->posX = player->posX; + proj->posY = player->posY; + + barrel--; + PlaySound(shot); + t = GetTime(); + // here + // + // + // there + if (barrel == 0) { + empty = true; + } + return (0); + } +} + +Projectile const& wp_nadelauncher::getProjectile() const { + return (projectile); +} |