diff options
| author | LLLL Colonq <llll@colonq> | 2026-08-03 19:36:31 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2026-08-03 19:36:31 -0400 |
| commit | a75221ab93f59d688f90cd83f0284ff98951fcfa (patch) | |
| tree | 215c9480f5b1bfdf63f9a0141b06a7cbefaab2e8 /2026/games_submissions/just__jane/src/cut.cpp | |
| parent | 9127154100230e8d60ab5139fb1bc626b24068ee (diff) | |
Update
Diffstat (limited to '2026/games_submissions/just__jane/src/cut.cpp')
| -rw-r--r-- | 2026/games_submissions/just__jane/src/cut.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/2026/games_submissions/just__jane/src/cut.cpp b/2026/games_submissions/just__jane/src/cut.cpp new file mode 100644 index 0000000..67e4c25 --- /dev/null +++ b/2026/games_submissions/just__jane/src/cut.cpp @@ -0,0 +1,37 @@ +#include "raylib.h" +#include "raymath.h" +#include <cut.hpp> + +Cut::Cut(Vector2 start, Vector2 end) { + InitAudioDevice(); + this->start_ = start; + this->end_ = end; + this->current_step_ = 0.0; + this->slash_ = LoadSound("assets/slash.wav"); +} + +void Cut::Draw() { + if (this->its_joever) { + return; + } + + Vector2 head = Vector2Lerp(start_, end_, current_step_); + DrawLineV(start_, head, {0x0F, 0x0F, 0x0F, 0x40}); +} + +void Cut::Update() { + if (this->its_joever) { + return; + } + + if (this->current_step_ == 0.0) { + PlaySound(slash_); + } + + if (this->current_step_ >= 1.0) { + this->its_joever = true; + return; + } + + this->current_step_ += (1.0 / 60.0); +} |
