Who knows

This commit is contained in:
Benjamin Morgan 2025-09-26 09:26:47 -06:00
parent eaf5a55d18
commit 32e50969b4
45 changed files with 38346 additions and 38306 deletions

View file

@ -1,33 +1,33 @@
#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, const sf::SoundBuffer& buffer, float volume, double effectiveAngle, int frameDelay) : Weapon(frameDelay, effectiveAngle, buffer, volume) {
projectile = std::move(_proj);
}
Shootable* shoot(const Ship* shooter) override {
currentFrame = 0;
noise.play();
projectile.setDirection(shooter->getDirection());
projectile.setPosition(shooter->getXPos() + shooter->getLocalBounds().width/4 * shooter->getScale().x * cos(shooter->getDirection()*GameSprite::PI/180), shooter->getYPos() - shooter->getLocalBounds().width/4 * shooter->getScale().x * sin(shooter->getDirection()*GameSprite::PI/180));
projectile.setShooter((GameSprite *) shooter);
Shootable *copied = new Shootable(projectile);
return copied;
}
};
#endif //SFML_TEMPLATE_PROJECTILEWEAPON_H
#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, const sf::SoundBuffer& buffer, float volume, double effectiveAngle, int frameDelay) : Weapon(frameDelay, effectiveAngle, buffer, volume) {
projectile = std::move(_proj);
}
Shootable* shoot(const Ship* shooter) override {
currentFrame = 0;
noise.play();
projectile.setDirection(shooter->getDirection());
projectile.setPosition(shooter->getXPos() + shooter->getLocalBounds().width/4 * shooter->getScale().x * cos(shooter->getDirection()*GameSprite::PI/180), shooter->getYPos() - shooter->getLocalBounds().width/4 * shooter->getScale().x * sin(shooter->getDirection()*GameSprite::PI/180));
projectile.setShooter((GameSprite *) shooter);
Shootable *copied = new Shootable(projectile);
return copied;
}
};
#endif //SFML_TEMPLATE_PROJECTILEWEAPON_H