aboutsummaryrefslogtreecommitdiff
path: root/src/muntik.odin
diff options
context:
space:
mode:
authoriamcheeseman <[email protected]>2026-03-06 18:55:27 -0500
committeriamcheeseman <[email protected]>2026-03-06 18:55:27 -0500
commit4c0c7682433a6da363ed8d608766fe8b52b70669 (patch)
tree988538c2e765abe93cfcc5d82885c9814ed37c2d /src/muntik.odin
parent3c7c93a2d844448ac9e8234418a786206a851596 (diff)
yayyy hugbug
Diffstat (limited to 'src/muntik.odin')
-rw-r--r--src/muntik.odin16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/muntik.odin b/src/muntik.odin
index 4644829..6abee4a 100644
--- a/src/muntik.odin
+++ b/src/muntik.odin
@@ -52,23 +52,13 @@ update_muntik :: proc(e: ^Enemy, dt: f32) {
}
vel := phys.get_velocity(m.body)
- vel.x = dt_lerp(vel.x, m.walk_dir * MUNTIK_SPEED, 20)
+ vel.x = dt_lerp(vel.x, m.walk_dir * MUNTIK_SPEED, MUNTIK_ACCEL)
vel.y = math.min(vel.y + GRAVITY * dt, TERMINAL_VELOCITY)
phys.set_velocity(m.body, vel)
- pos := phys.get_position(m.body)
-
- collisions := phys.get_colliding_bodies(m.body)
- defer delete(collisions)
+ contact_damage(m.body, MUNTIK_DAMAGE)
- for body in collisions {
- layers := phys.get_layers(body)
- if .Player in layers {
- bpos := phys.get_position(body)
- dir := linalg.normalize0(bpos - pos) * 500
- player_take_damage(MUNTIK_DAMAGE, dir)
- }
- }
+ pos := phys.get_position(m.body)
ground_rc_start := Vec2{pos.x + m.walk_dir * 4, pos.y}
ground_rc := phys.make_raycast(