This commit is contained in:
bMorgan01 2021-04-27 14:42:08 -06:00
commit 065d543d4d
262 changed files with 38368 additions and 0 deletions

31
ProjectileWeapon.h Normal file
View file

@ -0,0 +1,31 @@
#include <utility>
//
// Created by Benjamin on 4/20/2021.
//
#ifndef SFML_TEMPLATE_PROJECTILEWEAPON_H
#define SFML_TEMPLATE_PROJECTILEWEAPON_H
class ProjectileWeapon : public Weapon {
public:
ProjectileWeapon(Projectile _proj, int frameDelay) : Weapon(frameDelay) {
projectile = std::move(_proj);
}
Shootable* shoot(const Ship* shooter) {
currentFrame = 0;
projectile.setDirection(shooter->getDirection());
projectile.setPosition(shooter->getPosition());
projectile.setShooter((GameSprite *) shooter);
Shootable *copied = new Shootable(projectile);
return copied;
}
};
#endif //SFML_TEMPLATE_PROJECTILEWEAPON_H