Adoranda/include/engine.h

34 lines
1.1 KiB
C
Raw Normal View History

2021-07-29 18:33:22 +02:00
#pragma once
2021-08-05 03:12:40 +02:00
#define ENGINE_TICK 35
2021-08-15 03:46:49 +02:00
struct Game {
2021-08-08 01:43:26 +02:00
/*the current map to display*/
2021-08-15 03:46:49 +02:00
struct Map *map;
2021-08-08 01:43:26 +02:00
/*the player*/
2021-08-15 03:46:49 +02:00
struct Player *player;
2021-08-08 01:43:26 +02:00
/*list of all the characters on the map*/
2021-08-15 03:46:49 +02:00
struct Character **characters;
2021-08-19 02:29:51 +02:00
/*the camera*/
struct Camera *camera;
2021-08-08 01:43:26 +02:00
/*the background color*/
2021-08-05 03:12:40 +02:00
int background;
2021-07-29 18:33:22 +02:00
};
2021-08-15 03:10:05 +02:00
/*draw the current state of the game*/
2021-08-15 03:46:49 +02:00
void engine_draw(struct Game const *game);
2021-08-15 03:10:05 +02:00
/*draw the map around the player*/
2021-08-19 02:29:51 +02:00
void engine_draw_map(struct Game const *game);
2021-08-15 03:10:05 +02:00
/*draw the player*/
void engine_draw_player(struct Game const *game);
2021-08-15 03:10:05 +02:00
/*move the player to the direction*/
2021-08-15 03:46:49 +02:00
int engine_move(struct Game *game, int direction);
2021-08-15 03:10:05 +02:00
/*update the player animation*/
2021-08-15 03:46:49 +02:00
void engine_tick(struct Game *game, int dt);
2021-08-15 03:10:05 +02:00
/*set the background color*/
2021-08-15 03:46:49 +02:00
void engine_set_background(struct Game *game, int color);
2021-08-15 03:10:05 +02:00
/*make an interaction with something*/
2021-08-15 03:46:49 +02:00
void engine_action(struct Game const *game, int action);
2021-08-15 03:10:05 +02:00
/*check the current position of the player. To perform action depends of his location*/
2021-08-15 03:46:49 +02:00
void engine_check_position(struct Game *game);
2021-08-19 02:29:51 +02:00
void vec_lerp(struct Camera *from, struct Player const *to, float scale);