Files
PlanetFleet/projectile.h
T
devZoGok a7718cb9e1 corrected unit removal
dropping the SUPPLY order if there are no extractors
addded optional exact destination pos to shortest paths
2024-01-24 14:54:34 +02:00

42 lines
966 B
C++
Executable File

#ifndef PROJECTILE_H
#define PROJECTILE_H
#include <SFML/Audio.hpp>
#include "gameObject.h"
#include <algorithm>
namespace vb01{
class Node;
}
namespace battleship {
enum class ProjectileClass{CRUISE_MISSILE, TORPEDO};
class Unit;
class Projectile : public GameObject{
public:
Projectile(Unit*, int, vb01::Vector3, vb01::Quaternion);
virtual ~Projectile();
virtual void update();
virtual void debug();
private:
void initProperties();
void initSound();
void checkCollision();
protected:
virtual void checkUnitCollision();
virtual void checkSurfaceCollision();
float speed, rayLength, explosionRadius, rotAngle;
int directHitDamage, explosionDamage;
vb01::Vector3 initPos;
Unit *unit = nullptr;
sf::SoundBuffer *shotSfxBuffer, *explosionSfxBuffer;
sf::Sound *shotSfx = nullptr, *explosionSfx = nullptr;
};
}
#endif