29 lines
519 B
C
29 lines
519 B
C
|
//
|
||
|
// Created by bruno on 28.10.2023.
|
||
|
//
|
||
|
|
||
|
#ifndef TUNELLERBUTWORSE_SPRITE_H
|
||
|
#define TUNELLERBUTWORSE_SPRITE_H
|
||
|
|
||
|
#include <SDL.h>
|
||
|
#include <string>
|
||
|
|
||
|
class Sprite {
|
||
|
public:
|
||
|
Sprite(std::string filename, SDL_Renderer* renderer, SDL_Rect* targetRect);
|
||
|
~Sprite();
|
||
|
|
||
|
int render(SDL_Renderer* renderer);
|
||
|
|
||
|
int getX() const;
|
||
|
int getY() const;
|
||
|
void moveTo(int x, int y);
|
||
|
void moveRelative(int x, int y);
|
||
|
|
||
|
private:
|
||
|
SDL_Texture* sprite;
|
||
|
SDL_Rect* targetRect;
|
||
|
};
|
||
|
|
||
|
#endif //TUNELLERBUTWORSE_SPRITE_H
|