weapon recoil

This commit is contained in:
wooshings
2026-09-28 17:43:25 -07:00
parent f453d0b1bf
commit 2648fa1316
4 changed files with 20 additions and 7 deletions
+2 -1
View File
@@ -21,6 +21,7 @@ main :: proc() {
player = Player {
transform = Transform{position = {4, 8}},
camera = rl.Camera2D{target = {0, 0}, zoom = 1.5},
weapon = Weapon{dmg = 1, rpm = 450, cooldown = false},
}
world.entities[player.transform.position] = player
enemy = Enemy {
@@ -88,7 +89,7 @@ draw :: proc() {
}
}
if rl.IsMouseButtonPressed(rl.MouseButton.LEFT) {
if rl.IsMouseButtonDown(rl.MouseButton.LEFT) {
pos := rl.GetScreenToWorld2D(rl.GetMousePosition(), player.camera)
pos_x := int(pos.x / CELL_SIZE) * CELL_SIZE
pos_y := int(pos.y / CELL_SIZE) * CELL_SIZE