Skip to content

Commit

Permalink
Merge branch 'andrew-dev' of https://github.com/Vpollo/Genious into a…
Browse files Browse the repository at this point in the history
…ndrew-dev
  • Loading branch information
Vpollo committed Dec 7, 2023
2 parents ef7b88d + c675168 commit bf5b021
Show file tree
Hide file tree
Showing 14 changed files with 59 additions and 1 deletion.
53 changes: 53 additions & 0 deletions PlayMode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ---------------------

Expand Down Expand Up @@ -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;
});
};
}
}


Expand All @@ -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() {
Expand Down Expand Up @@ -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);
}
Expand Down
5 changes: 5 additions & 0 deletions PlayMode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string, WalkMesh const *> walkmesh_map;

Expand Down Expand Up @@ -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 -----

Expand Down
Binary file modified dist/level/level.pnct
Binary file not shown.
Binary file modified dist/level/level.scene
Binary file not shown.
Binary file modified dist/level/walkmeshes.w
Binary file not shown.
Binary file removed dist/maze_portal.pnct
Binary file not shown.
Binary file removed dist/maze_portal.scene
Binary file not shown.
Binary file removed dist/maze_portal.w
Binary file not shown.
Binary file added dist/textures/credits.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/textures/thanks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/textures/title.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file modified scenes/intro.blend
Binary file not shown.
Binary file modified scenes/portal_demo/maze_portal.blend
Binary file not shown.

0 comments on commit bf5b021

Please sign in to comment.