-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathObject.hpp
More file actions
34 lines (31 loc) · 922 Bytes
/
Object.hpp
File metadata and controls
34 lines (31 loc) · 922 Bytes
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
#pragma once
#include "Game.hpp"
class Object
{
public:
void initObject(const char *filename, int x, int y);
void Update();
void Render();
void setSource(int x, int y, int w, int h);
void setDest(int x, int y, int w, int h);
void setSource(int x, int y);
void setDest(int x, int y);
SDL_Rect getDest() const { return dstRect; }
SDL_Rect getSource() const { return srcRect; }
int getDX() const { return dstRect.x; }
int getDY() const { return dstRect.y; }
int getDW() const { return dstRect.w; }
int getDH() const { return dstRect.h; }
void setId(int i) { id = i; }
int getId() const { return id; }
int id;
int xpos;
int ypos;
// SDL_Rect giveCurrentPosition();
SDL_Rect srcRect;
SDL_Rect dstRect;
SDL_Texture *objTexture;
SDL_Rect tmpRect;
// SDL_Renderer *renderer;
// int speed = 4; //should be factor of tile size
};