2024-02-27 23:57:37 +00:00
|
|
|
#include "art/game_player.h"
|
2024-02-27 23:09:51 +00:00
|
|
|
#include "art/game_tiles.h"
|
2024-02-26 00:40:33 +00:00
|
|
|
#include "device/device.h"
|
2024-02-27 04:19:22 +00:00
|
|
|
#include "map/game_map.h"
|
2024-02-25 03:00:23 +00:00
|
|
|
#include "game.h"
|
2024-02-26 02:38:53 +00:00
|
|
|
#include "sys/sys.h"
|
2024-02-28 03:57:37 +00:00
|
|
|
#include <stdio.h>
|
2024-02-25 03:00:23 +00:00
|
|
|
|
|
|
|
uint32_t game_frame;
|
|
|
|
|
2024-02-26 02:38:53 +00:00
|
|
|
const char* game_title() {
|
|
|
|
return "Croc Party!";
|
|
|
|
}
|
|
|
|
|
2024-02-25 03:00:23 +00:00
|
|
|
void game_init() {
|
2024-02-26 02:38:53 +00:00
|
|
|
sys_init();
|
|
|
|
|
2024-02-28 21:14:48 +00:00
|
|
|
map_game_map_create_entities();
|
|
|
|
|
2024-02-27 23:57:37 +00:00
|
|
|
game_palette_init();
|
2024-02-28 05:07:15 +00:00
|
|
|
game_player_init();
|
2024-02-26 02:38:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void game_destroy() {
|
|
|
|
sys_destroy();
|
2024-02-25 03:00:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void game_update() {
|
2024-02-28 05:07:15 +00:00
|
|
|
sys_update();
|
2024-02-28 03:57:37 +00:00
|
|
|
|
2024-02-28 05:07:15 +00:00
|
|
|
game_frame += 1;
|
2024-02-29 00:10:09 +00:00
|
|
|
game_collectibles_update();
|
2024-02-29 03:42:03 +00:00
|
|
|
game_npcs_update();
|
2024-02-28 05:07:15 +00:00
|
|
|
game_player_update();
|
2024-02-28 03:57:37 +00:00
|
|
|
|
2024-02-25 03:00:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void game_draw() {
|
2024-02-27 23:57:37 +00:00
|
|
|
sys_cls(9);
|
2024-02-27 01:31:58 +00:00
|
|
|
|
2024-02-28 20:54:59 +00:00
|
|
|
game_player_set_camera();
|
|
|
|
sys_map_draw(map_game_map, spr_game_tiles, 0, 0, 0, 0, map_game_map.width, map_game_map.height);
|
2024-02-29 00:10:09 +00:00
|
|
|
|
|
|
|
game_collectibles_draw();
|
2024-02-29 03:42:03 +00:00
|
|
|
game_npcs_draw();
|
2024-02-28 05:07:15 +00:00
|
|
|
game_player_draw();
|
2024-02-28 20:54:59 +00:00
|
|
|
|
|
|
|
sys_camera_reset();
|
2024-02-25 03:00:23 +00:00
|
|
|
}
|