aboutsummaryrefslogtreecommitdiff
path: root/src/bullet.odin
diff options
context:
space:
mode:
authoriamcheeseman <[hidden email]>2026-02-13 20:42:28 -0500
committeriamcheeseman <[hidden email]>2026-02-13 20:42:28 -0500
commit1ff729f696c895f81f0cf0d1b8a2cca1d6e43eb8 (patch)
tree040bf0ffe933d424951159380af83c927a55a9fe /src/bullet.odin
parentc6261cc09f97568ad5ea966662697e01ea17b861 (diff)
simple raycasting mmmmmm
Diffstat (limited to 'src/bullet.odin')
-rw-r--r--src/bullet.odin5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bullet.odin b/src/bullet.odin
index da6af73..ceb2ce9 100644
--- a/src/bullet.odin
+++ b/src/bullet.odin
@@ -4,6 +4,7 @@ import "core:math"
import "core:math/linalg"
import "core:log"
+import "fw"
import "phys"
Bullet :: struct {
@@ -21,13 +22,13 @@ make_bullet :: proc(
lifetime: f32 = 5,
image_id := Image_Id.Bullet,
layers: bit_set[phys.Layer;u16] = {.Player_Projectile},
- mask: bit_set[phys.Layer;u16] = {.Default},
+ mask: bit_set[phys.Layer;u16] = {.Hard},
) -> (Entity_Handle, ^Bullet) {
sprite: Sprite
init_sprite(&sprite, image_id)
set_sprite_offset_percentage(&sprite, {0, 0.5})
- sprite.rotation = math.atan2(vel.y, vel.x) * math.DEG_PER_RAD
+ sprite.rotation = math.atan2(vel.y, vel.x)
sprite.pos = pos
body_rect := phys.Rect{