42 lines
796 B
C
42 lines
796 B
C
#include "camera.h"
|
|
#include "level.h"
|
|
#include "program.h"
|
|
#include "player.h"
|
|
#include "sprite_entity.h"
|
|
|
|
static Player* player = NULL;
|
|
static Level* level = NULL;
|
|
|
|
static
|
|
void play() {
|
|
g_camera.fov = 40;
|
|
|
|
player = player_new();
|
|
player_spawn(player, (Vector){2.25f, 15.f});
|
|
|
|
level = level_load("level_0");
|
|
}
|
|
|
|
static
|
|
void tick() {
|
|
g_camera.transform.position = player->transform.position;
|
|
}
|
|
|
|
static
|
|
void draw() {
|
|
sprite_entity_draw(Player_as_SpriteEntity(player));
|
|
level_draw(level);
|
|
}
|
|
|
|
int main(int argc, char* argv[]) {
|
|
struct ProgramSettings config = {
|
|
.target_fps = 240,
|
|
.title = "fencer",
|
|
.view_resolution = {1920, 1080},
|
|
.on_play = &play,
|
|
.on_tick = &tick,
|
|
.on_draw = &draw
|
|
};
|
|
program_run(&config);
|
|
}
|