-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProjectile.h
42 lines (39 loc) · 2.01 KB
/
Projectile.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#pragma once
#include <SFML\Graphics.hpp>
#include "Constants.h"
class Projectile
{
public:
Projectile();
Projectile(game_nmspc::Position2f gvnPosition, game_nmspc::Position2f gvnDirection);
Projectile(sf::Vector2f _projectileDestination, sf::Vector2f _projectilePosition);
/*Projectile(float _projectileSpeed, sf::Vector2f _projectileDestination, float _amountOfDamage, float _maxLifeTime, sf::Vector2f _projectilePosition, PROJECTILE_TYPE _projectileType);
Projectile(float _projectileSpeed, sf::Vector2f _projectileDestination, float _amountOfDamage, float _maxLifeTime, sf::Vector2f _projectilePosition, PROJECTILE_TYPE _projectileType, bool _isMovingUp, bool _isMovingDown, bool _isMovingRight, bool _isMovingLeft);*/
Projectile(const Projectile &gvnProjectile, sf::Vector2f _projectileDestination, sf::Vector2f _projectilePosition);
~Projectile();
void SetDamage(float _amountOfDamage);
void SetSpeed(float _projectileSpeed);
void SetDestination(sf::Vector2f _projectileDestination);
void SetLifeTime(float _maxLifeTime);
void SetParameters(float _amountOfDamage, float _projectileSpeed, float _maxLifeTime);
void SetProjectileType(PROJECTILE_TYPE _projectileType);
void SetProjectilePosition( sf::Vector2f &_projectilePosition);
void SetProjectileVectors( sf::Vector2f &_projectilePosition, sf::Vector2f &_projectileDestination);
float ReturnProjectileSpeed();
sf::Vector2f ReturnProjectileDestination();
float ReturnAmountOfDamage();
sf::Vector2f ReturnProjectilePosition();
PROJECTILE_TYPE ReturnProjectileType();
bool CheckIfExceededMaxLifeTime();
void SetBoundingBox(const sf::FloatRect gvnBoundingBox);
sf::FloatRect ReturnBoundingBox();
private:
float projectileSpeed; //pixels per frame
sf::Vector2f projectileDestination;
sf::FloatRect projectileBoundingBox;
float amountOfDamage;
sf::Time maxLifeTime; //denotes how long the projectile should last (game has no bounds)
sf::Clock projectileLifeTime;
sf::Vector2f projectilePosition;
PROJECTILE_TYPE projectileType;
};