aboutsummaryrefslogtreecommitdiff
path: root/game/mainmenu/ITransitionScript.cpp
diff options
context:
space:
mode:
authorJAROWMR <jarorutjes07@gmail.com>2025-01-03 21:02:48 +0100
committerJAROWMR <jarorutjes07@gmail.com>2025-01-03 21:02:48 +0100
commit5ae4e3f0e3ff1d111eaea54b7b0a0788203d9d72 (patch)
treeabd7e7965eaff19c76daecb8a3f4514106562a09 /game/mainmenu/ITransitionScript.cpp
parent209957a36c19968292032ead5974a695b22ffceb (diff)
bug fix
Diffstat (limited to 'game/mainmenu/ITransitionScript.cpp')
-rw-r--r--game/mainmenu/ITransitionScript.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/game/mainmenu/ITransitionScript.cpp b/game/mainmenu/ITransitionScript.cpp
index 433f9f7..e923073 100644
--- a/game/mainmenu/ITransitionScript.cpp
+++ b/game/mainmenu/ITransitionScript.cpp
@@ -4,6 +4,7 @@
#include "iostream"
#include <crepe/api/Camera.h>
#include "MainMenuConfig.h"
+#include "types.h"
using namespace crepe;
using namespace std;
@@ -13,6 +14,10 @@ void ITransitionScript::frame_update(crepe::duration_t delta_time){
{
// cout << "transition:" << velocity << std::endl;
Transform & cam = this->get_components_by_name<Transform>(MainMenuConfig::CAMERA_NAME).front();
+ RefVector<Transform> info_tf = this->get_components_by_tag<Transform>(MainMenuConfig::MENU_INFO_TAG);
+ for (Transform & tf : info_tf) {
+ tf.position.y -= MainMenuConfig::VELOCITY_INFO_UP * delta_time.count();
+ }
if(velocity < MainMenuConfig::VELOCITY_MAX && cam.position.x < MainMenuConfig::SLOW_DOWN) velocity += MainMenuConfig::VELOCITY_STEP * delta_time.count();
else if(velocity > 20) velocity -= MainMenuConfig::VELOCITY_STEP * delta_time.count();
if(cam.position.x < MainMenuConfig::END) cam.position.x += (velocity * delta_time.count());