2023-11-12 14:17:09 +00:00
|
|
|
#ifndef STRUCTS_H
|
|
|
|
#define STRUCTS_H
|
|
|
|
|
|
|
|
#include <SDL2/SDL.h>
|
|
|
|
|
|
|
|
struct game {
|
|
|
|
SDL_Window *window;
|
|
|
|
SDL_Renderer *renderer;
|
|
|
|
|
|
|
|
int left;
|
|
|
|
int right;
|
|
|
|
};
|
|
|
|
|
2023-11-12 18:43:14 +00:00
|
|
|
struct animation {
|
|
|
|
SDL_Texture *tilemap;
|
|
|
|
int resolution;
|
|
|
|
|
|
|
|
int skippable;
|
|
|
|
};
|
|
|
|
|
2023-11-12 14:17:09 +00:00
|
|
|
struct object {
|
2023-11-12 18:43:14 +00:00
|
|
|
SDL_Texture *texture;
|
|
|
|
int resolution; // of the texture/every tile
|
2023-11-12 14:17:09 +00:00
|
|
|
|
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
int scale;
|
2023-11-12 18:43:14 +00:00
|
|
|
Uint32 flip;
|
2023-11-12 14:17:09 +00:00
|
|
|
|
|
|
|
// animation
|
2023-11-12 18:43:14 +00:00
|
|
|
double animation_clock; // everytime it reaches 1, the texture switches to the next slide
|
|
|
|
double animation_speed; // how fast will the clock reach 1 with respect to delta_time
|
|
|
|
int animation_slide; // the current slide of the animation
|
2023-11-12 14:17:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|