shooting added

This commit is contained in:
PfandBoss
2022-12-11 08:27:49 +01:00
parent 6a4aa05a18
commit 5995a131b0
2 changed files with 13 additions and 1 deletions

View File

@@ -55,9 +55,14 @@ func shoot():
currentStashValue -= 1
currentPowderStashValue = 0
currentState = STATE.INACTIVE
var bullet = preload("res://cannonball.tscn").instantiate()
add_child(bullet)
print(bullet.position)
var tween = bullet.create_tween()
tween.tween_property(bullet,"position",Vector3(70,0,0),0.5)
tween.tween_callback(queue_free)
$AudioStreamPlayer.play(0)
return true
if currentStashValue >= 1 and currentPowderStashValue >= 2 and currentState == STATE.INACTIVE and ammoType == 1:
currentState = STATE.SHOOTING
currentStashValue -= 1