diff options
| author | iamcheeseman <[hidden email]> | 2026-02-03 22:25:00 -0500 |
|---|---|---|
| committer | iamcheeseman <[hidden email]> | 2026-02-03 22:25:00 -0500 |
| commit | 3d1d31538d30a7f161f9f2b6d5e075ec69d3b860 (patch) | |
| tree | 8b0deceb38c288dbef361bb4f77bb681b5566525 /src/rope.odin | |
| parent | 1c605da3ff8dc4295d2f9a85f5b7c8891ca84464 (diff) | |
ditch raylib (icky, and for loser BEGINNERS)
Diffstat (limited to 'src/rope.odin')
| -rw-r--r-- | src/rope.odin | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/rope.odin b/src/rope.odin index b321dab..7e2cbe1 100644 --- a/src/rope.odin +++ b/src/rope.odin @@ -4,7 +4,7 @@ import "core:log" import "core:math" import "core:math/linalg" -import rl "vendor:raylib" +import "fw" Rope :: struct { handle: Entity_Handle, @@ -25,10 +25,10 @@ draw_ropes :: proc() { for i in 0..<len(rope.verlet.nodes) - 1 { cur := rope.verlet.nodes[i] nex := rope.verlet.nodes[i + 1] - rl.DrawLineV( + fw.draw_line( linalg.round(cur.pos), linalg.round(nex.pos), - rl.Color{76, 62, 36, 255}, + color = fw.rgba8(76, 62, 36), ) } @@ -36,14 +36,14 @@ draw_ropes :: proc() { b := rope.verlet.nodes[len(rope.verlet.nodes) - 2] dir := b.pos - a.pos - rotation := math.atan2(dir.y, dir.x) * math.DEG_PER_RAD + 90 + rotation := math.atan2(dir.y, dir.x) + math.PI / 2 img := get_image(rope.hanging_id) - draw_texture( + fw.draw_tex_ex( img, a.pos, - offset = linalg.round(Vec2{f32(img.width) * 0.5, 0}), - rotation = rotation, + offset = linalg.round(Vec2{f32(img.size.x) * 0.5, 0}), + rot = rotation, ) } } |
