-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameObject.h
44 lines (29 loc) · 975 Bytes
/
GameObject.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
43
44
#pragma once
#include <string>
#include <iostream>
#include "Texture.h"
class GameObject
{
public:
GameObject(int x, int y, int width, int height, std::string texturePath)
:x(x), y(y), height(height), width(width), texture(new Texture(texturePath)), isDestroyed(false) {};
~GameObject() { delete texture; };
virtual void ballCollisionEffect() = 0;
inline int getHeight() { return height; };
inline int getWidth() { return width; };
inline int getX() { return x; };
inline int getY() { return y; };
inline void setX(float x) { this->x = x; };
inline void setY(float y) { this->y = y; };
virtual void onClick() {};
inline bool getIsDestroyed() { return isDestroyed; };
virtual const Texture* getTexture() { return texture; };
protected:
bool isDestroyed;
int height;
int width;
Texture* texture;
// int graphicLayerImportance; //for example 0 - background
double x;
double y;
};