weapon recoil
This commit is contained in:
+2
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user