A retro platform game
git clone git://soophie.de/freezo
blob: fb424a1d86bd8e65926a88c282ddd2aea9261f94 (1079 bytes)[raw]
1
#pragma once3
#include <stdbool.h>5
#include "../lib/raylib.h"7
#define UNUSED(x) (void)(x)9
typedef Vector2 pos_t;10
typedef Rectangle rect_t;11
typedef struct Timer fz_timer_t;13
#include "game.h"15
struct Timer {16
int frames;17
int count;18
int step;19
};21
fz_timer_t *fz_timer_create(int frames, int step);22
bool fz_timer_check(fz_timer_t *timer);23
void fz_timer_update(fz_timer_t *timer);24
void fz_timer_reset(fz_timer_t *timer);25
int fz_timer_get(fz_timer_t *timer);26
void fz_timer_free(fz_timer_t *timer);28
pos_t pos_snap(pos_t vec);30
rect_t rect_from_pos(pos_t pos, int width, int height);31
bool rect_collide(rect_t a, rect_t b);32
bool rect_collide_threshold(rect_t a, rect_t b, float threshold);34
Texture texture_load(char *filename, int scale);35
Rectangle texture_rect(int x, int y, int width, int height);36
Rectangle texture_rect_v(int x, int y, int width, int height, int size_x, int size_y);38
typedef enum {39
TEXT_ALIGNMENT_LEFT,40
TEXT_ALIGNMENT_RIGHT,41
TEXT_ALIGNMENT_CENTER,42
} text_alignment_e;44
void text_draw(pos_t pos, char *text, text_alignment_e alignment, game_t *game);