mirror of
https://github.com/PfandBoss/SemesterGameJam2022.git
synced 2025-11-12 04:16:12 +01:00
exports
This commit is contained in:
7
scripts/3DUI/dreieck.gd
Normal file
7
scripts/3DUI/dreieck.gd
Normal file
@@ -0,0 +1,7 @@
|
||||
extends Node3D
|
||||
|
||||
func _on_area_3d_input_event(camera, event, position, normal, shape_idx):
|
||||
if event is InputEventMouseButton:
|
||||
if event.button_index == MOUSE_BUTTON_LEFT and event.pressed == true:
|
||||
print("Start Game")
|
||||
|
||||
@@ -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(bullet.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
|
||||
|
||||
Reference in New Issue
Block a user