aboutsummaryrefslogtreecommitdiff
path: root/src/rope.odin
diff options
context:
space:
mode:
Diffstat (limited to 'src/rope.odin')
-rw-r--r--src/rope.odin14
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,
)
}
}