summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyren223 <Kyren223@proton.me>2025-07-26 11:46:23 +0300
committerKyren223 <Kyren223@proton.me>2025-07-26 11:46:23 +0300
commitd0e629a6db08dc84e7bd11940d276616ab085f1c (patch)
tree808e424f75aa8b9c50f4aa5fcf297d6e3935ed4e
parent7eb39d473b556bd37476ac1841f46883a2e50069 (diff)
Animation is working
-rw-r--r--src/main.zig10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main.zig b/src/main.zig
index 81b8bb9..f419dfd 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -76,10 +76,10 @@ const Bug = struct {
pub fn update(self: *Bug, delta_time: f32, wave: *Wave) void {
self.animation_time += delta_time;
- // if (self.animation_time > animation_switch_threshold) {
- // self.animation_time = 0;
- // self.animation_state = @mod((self.animation_state + 1), animationCount(self.kind));
- // }
+ if (self.animation_time > animation_switch_threshold) {
+ self.animation_time = 0;
+ self.animation_state = @mod((self.animation_state + 1), animationCount(self.kind));
+ }
var velocity: rl.Vector2 = self.target.subtract(self.position);
velocity = velocity.normalize().scale(speed(self.kind));
@@ -252,7 +252,7 @@ const Wave = struct {
.from_time_s = 0,
.to_time_s = 10,
.bugs = .{
- .{ .spawn_interval = 1 },
+ .{ .spawn_interval = 3 },
.{ .spawn_interval = 0 },
.{ .spawn_interval = 0 },
},