ObjectItem class added to accordance of diagram class
This commit is contained in:
@@ -4,22 +4,12 @@
|
||||
#include "SFML/Graphics/Texture.hpp"
|
||||
#include "SFML/Graphics/Sprite.hpp"
|
||||
#include "Position.h"
|
||||
#include "ObjectItem.hpp"
|
||||
|
||||
class Meteor {
|
||||
class Meteor : public ObjectItem {
|
||||
public:
|
||||
Meteor(float x, float y, sf::Texture &texture);
|
||||
sf::Sprite &getSprite();
|
||||
bool getStatus();
|
||||
void update();
|
||||
// ~Meteor();
|
||||
private:
|
||||
sf::Texture meteorTexture;
|
||||
sf::Sprite meteorSprite;
|
||||
Position meteorPosition;
|
||||
float meteorRotationSpeed;
|
||||
float meteorSpeed;
|
||||
bool outOfBounds;
|
||||
static unsigned int counter;
|
||||
};
|
||||
|
||||
|
||||
|
||||
24
headers/ObjectItem.hpp
Normal file
24
headers/ObjectItem.hpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef LOTOSTATEK_OBJECTITEM_HPP
|
||||
#define LOTOSTATEK_OBJECTITEM_HPP
|
||||
|
||||
#include "SFML/Graphics/Sprite.hpp"
|
||||
#include "Position.h"
|
||||
#include "SFML/Graphics/Texture.hpp"
|
||||
|
||||
class ObjectItem {
|
||||
public:
|
||||
ObjectItem(float x, float y, sf::Texture &texture);
|
||||
sf::Sprite &getSprite();
|
||||
bool getStatus();
|
||||
virtual void update() = 0;
|
||||
protected:
|
||||
sf::Texture texture;
|
||||
sf::Sprite sprite;
|
||||
Position position;
|
||||
float rotationSpeed;
|
||||
float movingSpeed;
|
||||
bool outOfBounds;
|
||||
static unsigned int counter;
|
||||
};
|
||||
|
||||
#endif //LOTOSTATEK_OBJECTITEM_HPP
|
||||
Reference in New Issue
Block a user