diff options
author | JAROWMR <jarorutjes07@gmail.com> | 2024-12-22 00:11:56 +0100 |
---|---|---|
committer | JAROWMR <jarorutjes07@gmail.com> | 2024-12-22 00:11:56 +0100 |
commit | 7bcee4f662b20b8e2e7183bb6bd4cb061fa14e12 (patch) | |
tree | cb7976922b3cc6070dc9c14d0ffcaea48b3efee6 /game/mainmenu/ButtonStartScript.h | |
parent | 5a2f6a14803885b7c53bab7d43208476d2e1bd5b (diff) |
added menu buttons + scene switching
Diffstat (limited to 'game/mainmenu/ButtonStartScript.h')
-rw-r--r-- | game/mainmenu/ButtonStartScript.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/game/mainmenu/ButtonStartScript.h b/game/mainmenu/ButtonStartScript.h new file mode 100644 index 0000000..3d6f920 --- /dev/null +++ b/game/mainmenu/ButtonStartScript.h @@ -0,0 +1,19 @@ +#pragma once + +#include <crepe/api/Script.h> + +class ButtonStartScript : public crepe::Script { +public: + void init() override; + void frame_update(crepe::duration_t delta_time) override; + bool on_button_press(const crepe::ButtonPressEvent& e); + bool on_button_enter(const crepe::ButtonEnterEvent& e); + bool on_button_exit(const crepe::ButtonExitEvent& e); +private: + bool transition = false; + static constexpr float SLOW_DOWN = 200; + static constexpr float END = 300; + const float velocity_max = 200; + const float velocity_step = 200; + float velocity = 20; +}; |