diff --git a/PlayMode.cpp b/PlayMode.cpp index df721de..60ff1a3 100644 --- a/PlayMode.cpp +++ b/PlayMode.cpp @@ -158,6 +158,19 @@ Load< Scene::Texture > shadow_texture(LoadTagDefault, []() -> Scene::Texture con return new Scene::Texture(data_path("textures/shadow.png")); }); +Load< Scene::Texture > title_texture(LoadTagDefault, []() -> Scene::Texture const * { + return new Scene::Texture(data_path("textures/title.png")); +}); + +Load< Scene::Texture > credits_texture(LoadTagDefault, []() -> Scene::Texture const * { + return new Scene::Texture(data_path("textures/credits.png")); +}); + +Load< Scene::Texture > thanks_texture(LoadTagDefault, []() -> Scene::Texture const * { + return new Scene::Texture(data_path("textures/thanks.png")); +}); + + // audio --------------------- @@ -652,6 +665,29 @@ PlayMode::PlayMode() : scene(*level_scene) { }; } + else if (b.name == "m_MilkBox") { + b.on_pressed = [&](){ + b.active = false; + b.drawable->transform->scale = glm::vec3(0); + scene.portals["MilkRoom"]->active = false; + timers.emplace_back(13.0f, [&](float alpha){ + if (alpha >= 0.769f) { + outro_count = 4; + } + else if (alpha >= 0.538f) { + outro_count = 3; + } + else if (alpha >= 0.308f) { + outro_count = 2; + } + else if (alpha >= 0.077f) { + outro_count = 1; + } + }, [&](){ + outro_count = 5; + }); + }; + } } @@ -676,6 +712,13 @@ PlayMode::PlayMode() : scene(*level_scene) { pause_text = Scene::ScreenImage(*pause_texture, glm::vec2(0), glm::vec2(0.4f), Scene::ScreenImage::Center, color_texture_program); + constexpr float title_hint_width = 0.4f * 4.0f; + + title_text = Scene::ScreenImage(*title_texture, glm::vec2(0), glm::vec2(title_hint_width, 0.4f), Scene::ScreenImage::Center, color_texture_program); + credits_text = Scene::ScreenImage(*credits_texture, glm::vec2(0), glm::vec2(title_hint_width, 0.4f), Scene::ScreenImage::Center, color_texture_program); + thanks_text = Scene::ScreenImage(*thanks_texture, glm::vec2(0), glm::vec2(title_hint_width, 0.4f), Scene::ScreenImage::Center, color_texture_program); + + } PlayMode::~PlayMode() { @@ -1395,6 +1438,16 @@ void PlayMode::draw(glm::uvec2 const &drawable_size) { controls_hint.draw(aspect); } + if (outro_count == 5) { + thanks_text.draw(aspect); + } + else if (outro_count == 3) { + credits_text.draw(aspect); + } + else if (outro_count == 1) { + title_text.draw(aspect); + } + if (paused) { pause_text.draw(aspect); } diff --git a/PlayMode.hpp b/PlayMode.hpp index 39acd69..b5e9abc 100644 --- a/PlayMode.hpp +++ b/PlayMode.hpp @@ -66,6 +66,9 @@ struct PlayMode : Mode { Scene::ScreenImage milk_hint; Scene::ScreenImage controls_hint; Scene::ScreenImage pause_text; + Scene::ScreenImage title_text; + Scene::ScreenImage credits_text; + Scene::ScreenImage thanks_text; std::unordered_map walkmesh_map; @@ -131,6 +134,8 @@ struct PlayMode : Mode { Scene::Transform *rotate_base = nullptr; Scene::Transform *hard_rot_base = nullptr; + int outro_count = 0; + //----- Screen Shader Related ----- diff --git a/dist/level/level.pnct b/dist/level/level.pnct index 11cfbf0..333b71c 100644 Binary files a/dist/level/level.pnct and b/dist/level/level.pnct differ diff --git a/dist/level/level.scene b/dist/level/level.scene index fd30356..87ad3cb 100644 Binary files a/dist/level/level.scene and b/dist/level/level.scene differ diff --git a/dist/level/walkmeshes.w b/dist/level/walkmeshes.w index fa6b5fa..0d2730a 100644 Binary files a/dist/level/walkmeshes.w and b/dist/level/walkmeshes.w differ diff --git a/dist/textures/credits.png b/dist/textures/credits.png new file mode 100644 index 0000000..479ffbd Binary files /dev/null and b/dist/textures/credits.png differ diff --git a/dist/textures/thanks.png b/dist/textures/thanks.png new file mode 100644 index 0000000..04a0cdf Binary files /dev/null and b/dist/textures/thanks.png differ diff --git a/dist/textures/title.png b/dist/textures/title.png new file mode 100644 index 0000000..99b2c91 Binary files /dev/null and b/dist/textures/title.png differ diff --git a/main.cpp b/main.cpp index 48a63c1..414cda5 100644 --- a/main.cpp +++ b/main.cpp @@ -68,7 +68,7 @@ int main(int argc, char **argv) { //create window: SDL_Window *window = SDL_CreateWindow( - "Genious Portal Demo", //TODO: remember to set a title for your game! + "Help! I'm Trapped in the Psychedelic Time Dimension Again (Second Time this Week)", //TODO: remember to set a title for your game! SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 1280, 720, //TODO: modify window size if you'd like SDL_WINDOW_OPENGL diff --git a/scenes/intro.blend b/scenes/intro.blend index a421e2f..91f2a04 100644 Binary files a/scenes/intro.blend and b/scenes/intro.blend differ diff --git a/scenes/portal_demo/maze_portal.blend b/scenes/portal_demo/maze_portal.blend index 35b5d90..23129f3 100644 Binary files a/scenes/portal_demo/maze_portal.blend and b/scenes/portal_demo/maze_portal.blend differ