Add game over text & reset camera mode on restart
parent
f35320cfe6
commit
e90856f8c6
|
@ -17,6 +17,7 @@ static RenderInfoNode all_tile_rendernodes[MAX_N_TILES] = {0};
|
||||||
#define CONTROL_LAYER 1
|
#define CONTROL_LAYER 1
|
||||||
static void level_scene_render_func(Scene_t* scene)
|
static void level_scene_render_func(Scene_t* scene)
|
||||||
{
|
{
|
||||||
|
Font* menu_font = get_font(&scene->engine->assets, "MenuFont");
|
||||||
LevelSceneData_t* data = &(CONTAINER_OF(scene, LevelScene_t, scene)->data);
|
LevelSceneData_t* data = &(CONTAINER_OF(scene, LevelScene_t, scene)->data);
|
||||||
|
|
||||||
static char buffer[512];
|
static char buffer[512];
|
||||||
|
@ -61,6 +62,10 @@ static void level_scene_render_func(Scene_t* scene)
|
||||||
air_pos.x -= 32;
|
air_pos.x -= 32;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (sc_map_size_64v(&scene->ent_manager.entities_map[PLAYER_ENT_TAG]) == 0)
|
||||||
|
{
|
||||||
|
DrawTextEx(*menu_font, "Press R to Try Again", (Vector2){32, data->game_rec.height/2 - 64}, 64, 4, WHITE);
|
||||||
|
}
|
||||||
// For DEBUG
|
// For DEBUG
|
||||||
int gui_x = 5;
|
int gui_x = 5;
|
||||||
sprintf(buffer, "%u %u", sc_map_size_64v(&scene->ent_manager.entities), GetFPS());
|
sprintf(buffer, "%u %u", sc_map_size_64v(&scene->ent_manager.entities), GetFPS());
|
||||||
|
@ -156,6 +161,7 @@ static void level_do_action(Scene_t* scene, ActionType_t action, bool pressed)
|
||||||
static void render_regular_game_scene(Scene_t* scene)
|
static void render_regular_game_scene(Scene_t* scene)
|
||||||
{
|
{
|
||||||
TracyCZoneN(ctx, "GameRender", true)
|
TracyCZoneN(ctx, "GameRender", true)
|
||||||
|
update_entity_manager(&scene->ent_manager);
|
||||||
// This function will render the game scene outside of the intended draw function
|
// This function will render the game scene outside of the intended draw function
|
||||||
// Just for clarity and separation of logic
|
// Just for clarity and separation of logic
|
||||||
LevelSceneData_t* data = &(CONTAINER_OF(scene, LevelScene_t, scene)->data);
|
LevelSceneData_t* data = &(CONTAINER_OF(scene, LevelScene_t, scene)->data);
|
||||||
|
|
|
@ -242,7 +242,6 @@ bool load_level_tilemap(LevelScene_t* scene, unsigned int level_num)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -288,6 +287,7 @@ bool load_level_tilemap(LevelScene_t* scene, unsigned int level_num)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scene->data.camera.mode = CAMERA_FOLLOW_PLAYER;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue