fp: Add new map and intro screen

This commit is contained in:
doyle 2023-10-13 00:05:41 +11:00
parent c63bdcacb4
commit a7de66b2f8
21 changed files with 153 additions and 29 deletions

BIN
Data/Textures/atlas.png (Stored with Git LFS)

Binary file not shown.

BIN
Data/Textures/atlas.txt (Stored with Git LFS)

Binary file not shown.

BIN
Data/Textures/atlas/end_screen.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Data/Textures/atlas/intro_screen_arrows.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Data/Textures/atlas/intro_screen_subtitle.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Data/Textures/atlas/intro_screen_terry.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Data/Textures/atlas/intro_screen_title.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Data/Textures/atlas/map.png (Stored with Git LFS)

Binary file not shown.

BIN
Data/Textures/atlas/map_billboard_attack.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Data/Textures/atlas/map_billboard_dash.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Data/Textures/atlas/map_billboard_monkey.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Data/Textures/atlas/map_billboard_range_attack.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Data/Textures/atlas/map_billboard_strafe.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Data/Textures/atlas/map_police_1.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Data/Textures/atlas/map_police_2.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Data/Textures/sprite_spec.txt (Stored with Git LFS)

Binary file not shown.

2
External/tely vendored

@ -1 +1 @@
Subproject commit b21c34597fb1ec7db2f4d240a4bf23bd0a4d96fa
Subproject commit b4b45f8d7cf37a4fced06d8afe4a693ee0604823

View File

@ -10,12 +10,4 @@ if not exist "%sprite_packer%" (
exit /B 1
)
REM %sprite_packer% 4096x4096 %script_dir%\Data\Textures\sprite_spec.txt %script_dir%\Data\Textures\terry_resized_25%% || exit /b 1
REM %sprite_packer% 4096x2048 %script_dir%\Data\Textures\sprite_spec.txt %script_dir%\Data\Textures\terry_merchant_resized_25%% || exit /b 1
REM %sprite_packer% 4096x2048 %script_dir%\Data\Textures\sprite_spec.txt %script_dir%\Data\Textures\smoochie_resized_25%% || exit /b 1
REM %sprite_packer% 4096x2048 %script_dir%\Data\Textures\sprite_spec.txt %script_dir%\Data\Textures\clinger_resized_25%% || exit /b 1
REM %sprite_packer% 4096x2048 %script_dir%\Data\Textures\sprite_spec.txt %script_dir%\Data\Textures\club_terry_resized_25%% || exit /b 1
REM %sprite_packer% 4096x2048 %script_dir%\Data\Textures\sprite_spec.txt %script_dir%\Data\Textures\map_resized_25%% || exit /b 1
REM %sprite_packer% 8192x8192 %script_dir%\Data\Textures\sprite_spec.txt %script_dir%\Data\Textures\heart_resized_25%% || exit /b 1
%sprite_packer% 4096x4096 %script_dir%\Data\Textures\sprite_spec.txt %script_dir%\Data\Textures\atlas || exit /b 1
%sprite_packer% 6144x6144 %script_dir%\Data\Textures\sprite_spec.txt %script_dir%\Data\Textures\atlas || exit /b 1

View File

@ -3227,13 +3227,9 @@ void FP_Render(FP_Game *game, TELY_Platform *platform, TELY_Renderer *renderer,
// NOTE: Render the other game state modes =====================================================
if (game->play.state == FP_GameState_IntroScreen || game->play.state == FP_GameState_WinGame || game->play.state == FP_GameState_LoseGame || game->play.state == FP_GameState_Pause) {
TELY_Render_PushTransform(renderer, Dqn_M2x3_Identity());
DQN_DEFER { TELY_Render_PopTransform(renderer); };
TELY_Render_RectColourV4(
renderer,
Dqn_Rect_InitNx4(0, 0, DQN_CAST(Dqn_f32)platform->core.window_size.x, DQN_CAST(Dqn_f32)platform->core.window_size.y),
TELY_RenderShapeMode_Fill,
TELY_Colour_V4Alpha(TELY_COLOUR_BLACK_V4, 0.8f));
Dqn_V2I inset = platform->core.window_size * .05f;
Dqn_f32 min_inset = DQN_CAST(Dqn_f32)DQN_MIN(inset.x, inset.y);
@ -3241,18 +3237,105 @@ void FP_Render(FP_Game *game, TELY_Platform *platform, TELY_Renderer *renderer,
Dqn_V2 draw_p = Dqn_V2_InitNx2(min_inset, min_inset);
TELY_Render_PushColourV4(renderer, TELY_COLOUR_WHITE_V4);
Dqn_V4 bg_colour = TELY_Colour_V4Alpha(TELY_COLOUR_BLACK_V4, 0.8f);
if (game->play.state == FP_GameState_IntroScreen)
bg_colour = TELY_Colour_V4InitRGBAU32(0x301010FF);
TELY_Render_RectColourV4(
renderer,
Dqn_Rect_InitNx4(0, 0, DQN_CAST(Dqn_f32)platform->core.window_size.x, DQN_CAST(Dqn_f32)platform->core.window_size.y),
TELY_RenderShapeMode_Fill,
bg_colour);
if (game->play.state == FP_GameState_IntroScreen) {
TELY_Render_PushFont(renderer, game->inter_regular_font_large);
TELY_Render_TextF(renderer, draw_p, Dqn_V2_Zero, "Feely Pona"); draw_p.y += TELY_Render_FontHeight(renderer, assets);
TELY_Render_PopFont(renderer);
Dqn_Rect window_rect = Dqn_Rect_InitNx4(0, 0, DQN_CAST(Dqn_f32)platform->core.window_size.w, DQN_CAST(Dqn_f32)platform->core.window_size.h);
Dqn_f32 tex_scalar = 0.f;
{
TELY_AssetSpriteAnimation *anim = TELY_Asset_GetSpriteAnimation(&game->atlas_sprite_sheet, g_anim_names.intro_screen_terry);
Dqn_Rect tex_rect = game->atlas_sprite_sheet.rects.data[anim->index];
Dqn_f32 desired_width = window_rect.size.x;
tex_scalar = desired_width / tex_rect.size.w;
}
{
TELY_AssetSpriteAnimation *anim = TELY_Asset_GetSpriteAnimation(&game->atlas_sprite_sheet, g_anim_names.intro_screen_terry);
Dqn_Rect tex_rect = game->atlas_sprite_sheet.rects.data[anim->index];
Dqn_Rect dest_rect = {};
dest_rect.size = tex_rect.size * tex_scalar;
dest_rect.pos = Dqn_Rect_InterpolatedPoint(window_rect, Dqn_V2_InitNx2(0.5f, 0.5f)) - (dest_rect.size * .5f);
TELY_Render_TextureColourV4(renderer,
game->atlas_sprite_sheet.tex_handle,
tex_rect,
dest_rect,
Dqn_V2_Zero /*rotate origin*/,
0.f /*rotation*/,
TELY_COLOUR_WHITE_V4);
}
{
TELY_AssetSpriteAnimation *anim = TELY_Asset_GetSpriteAnimation(&game->atlas_sprite_sheet, g_anim_names.intro_screen_arrows);
Dqn_Rect tex_rect = game->atlas_sprite_sheet.rects.data[anim->index];
Dqn_Rect dest_rect = {};
dest_rect.size = tex_rect.size * tex_scalar;
dest_rect.pos = Dqn_Rect_InterpolatedPoint(window_rect, Dqn_V2_InitNx2(0.5f, 0.5f)) - (dest_rect.size * .5f);
TELY_Render_TextureColourV4(renderer,
game->atlas_sprite_sheet.tex_handle,
tex_rect,
dest_rect,
Dqn_V2_Zero /*rotate origin*/,
0.f /*rotation*/,
TELY_COLOUR_WHITE_V4);
}
{
TELY_AssetSpriteAnimation *anim = TELY_Asset_GetSpriteAnimation(&game->atlas_sprite_sheet, g_anim_names.intro_screen_title);
Dqn_Rect tex_rect = game->atlas_sprite_sheet.rects.data[anim->index];
Dqn_Rect dest_rect = {};
dest_rect.size = tex_rect.size * tex_scalar;
dest_rect.pos = Dqn_Rect_InterpolatedPoint(window_rect, Dqn_V2_InitNx2(0.5f, 0.5f)) - (dest_rect.size * .5f);
TELY_Render_TextureColourV4(renderer,
game->atlas_sprite_sheet.tex_handle,
tex_rect,
dest_rect,
Dqn_V2_Zero /*rotate origin*/,
0.f /*rotation*/,
TELY_COLOUR_WHITE_V4);
}
{
TELY_AssetSpriteAnimation *anim = TELY_Asset_GetSpriteAnimation(&game->atlas_sprite_sheet, g_anim_names.intro_screen_subtitle);
Dqn_Rect tex_rect = game->atlas_sprite_sheet.rects.data[anim->index];
Dqn_Rect dest_rect = {};
dest_rect.size = tex_rect.size * tex_scalar;
dest_rect.pos = Dqn_Rect_InterpolatedPoint(window_rect, Dqn_V2_InitNx2(0.5f, 0.5f)) - (dest_rect.size * .5f);
TELY_Render_TextureColourV4(renderer,
game->atlas_sprite_sheet.tex_handle,
tex_rect,
dest_rect,
Dqn_V2_Zero /*rotate origin*/,
0.f /*rotation*/,
TELY_COLOUR_WHITE_V4);
}
TELY_Render_PushFont(renderer, game->inter_regular_font);
TELY_Render_TextF(renderer, draw_p, Dqn_V2_Zero, "Press enter to start"); draw_p.y += TELY_Render_FontHeight(renderer, assets);
TELY_Render_PopFont(renderer);
Dqn_f32 t = (DQN_SINF(DQN_CAST(Dqn_f32)input->timer_s * 5.f) + 1.f) / 2.f;
TELY_Render_PushColourV4(renderer, TELY_Colour_V4Alpha(TELY_COLOUR_WHITE_V4, t));
TELY_Render_TextF(renderer, Dqn_Rect_InterpolatedPoint(window_rect, Dqn_V2_InitNx2(0.5f, 0.925f)), Dqn_V2_InitNx1(0.5f), "Press enter to start");
TELY_Render_PopColourV4(renderer);
TELY_Render_PopFont(renderer);
Dqn_V2 screen_size = Dqn_V2_InitNx2(platform->core.window_size.w, platform->core.window_size.h);
Dqn_f32 scanline_gap = 4.0f;
Dqn_f32 scanline_thickness = 3.0f;
FP_GameRenderCameraFollowScanlines(renderer, screen_size, Dqn_V2_Zero, scanline_gap, scanline_thickness);
if (TELY_Platform_InputScanCodeIsPressed(input, TELY_PlatformInputScanCode_Return))
game->play.state = FP_GameState_Play;
} else if (game->play.state == FP_GameState_LoseGame) {
TELY_Render_PushFont(renderer, game->inter_regular_font_large);
TELY_Render_TextF(renderer, draw_p, Dqn_V2_Zero, "Terry's heart has been crushed"); draw_p.y += TELY_Render_FontHeight(renderer, assets);

View File

@ -47,6 +47,8 @@ struct FP_GlobalAnimations
Dqn_String8 club_terry_alive = DQN_STRING8("club_terry_alive");
Dqn_String8 club_terry_dark = DQN_STRING8("club_terry_dark");
Dqn_String8 end_screen = DQN_STRING8("end_screen");
Dqn_String8 heart = DQN_STRING8("heart");
Dqn_String8 heart_bleed = DQN_STRING8("heart_bleed");
@ -55,9 +57,20 @@ struct FP_GlobalAnimations
Dqn_String8 icon_phone = DQN_STRING8("icon_phone");
Dqn_String8 icon_stamina = DQN_STRING8("icon_stamina");
Dqn_String8 intro_screen_arrows = DQN_STRING8("intro_screen_arrows");
Dqn_String8 intro_screen_subtitle = DQN_STRING8("intro_screen_subtitle");
Dqn_String8 intro_screen_terry = DQN_STRING8("intro_screen_terry");
Dqn_String8 intro_screen_title = DQN_STRING8("intro_screen_title");
Dqn_String8 kennel_terry = DQN_STRING8("kennel_terry");
Dqn_String8 map = DQN_STRING8("map");
Dqn_String8 map = DQN_STRING8("map");
Dqn_String8 map_billboard_attack = DQN_STRING8("map_billboard_attack");
Dqn_String8 map_billboard_dash = DQN_STRING8("map_billboard_dash");
Dqn_String8 map_billboard_monkey = DQN_STRING8("map_billboard_monkey");
Dqn_String8 map_billboard_range_attack = DQN_STRING8("map_billboard_range_attack");
Dqn_String8 map_billboard_strafe = DQN_STRING8("map_billboard_strafe");
Dqn_String8 map_police = DQN_STRING8("map_police");
Dqn_String8 merchant_button_a = DQN_STRING8("merchant_button_a");
Dqn_String8 merchant_button_b = DQN_STRING8("merchant_button_b");

Binary file not shown.