wow, I created ground and fire

This commit is contained in:
elwld 2022-07-10 01:12:20 +05:00
parent c14d6e6c59
commit 2288fb8d15
14 changed files with 185 additions and 48 deletions

44
src/game/GameObject.h Normal file
View file

@ -0,0 +1,44 @@
#ifndef GAMEOBJECT
#define GAMEOBJECT
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
class Frame
{
public:
Frame(SDL_Rect dstrect, SDL_Rect srcrect, bool mirror = 0, int angle = 0)
{
this->dstrect = dstrect;
this->srcrect = srcrect;
this->mirror = mirror;
this->angle = angle;
}
public:
SDL_Rect dstrect;
SDL_Rect srcrect;
bool mirror;
int angle;
};
class GameObject
{
public:
GameObject(int x, int y, int w, int h)
{
(this->dstrect).x = x;
(this->dstrect).y = y;
(this->dstrect).w = w;
(this->dstrect).h = h;
}
virtual Frame frame()
{
return Frame((SDL_Rect){0,0,0,0}, (SDL_Rect){0,0,0,0});
}
protected:
SDL_Rect dstrect;
};
#endif //GAMEOBJECT