minor tweaks from last
This commit is contained in:
@@ -9,7 +9,7 @@ var ammo_current = [0,0]
|
||||
var ammo_reserve = [0,0]
|
||||
var guns_dict = {}
|
||||
var current_gun_index
|
||||
var money = 250
|
||||
var money = 0
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
|
||||
@@ -17,10 +17,7 @@ func _ready():
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
if active == false:
|
||||
while item_price > 0:
|
||||
item_price = lerp(int(item_price),int(0),delta * .01)
|
||||
label_3d.text = "$" + str(item_price)
|
||||
pass
|
||||
|
||||
func interact():
|
||||
if active == true:
|
||||
@@ -28,7 +25,10 @@ func interact():
|
||||
level_control.money -= item_price
|
||||
anim_player.play("vend")
|
||||
else:
|
||||
pass #add "too poor" text here
|
||||
var original_text = label_3d.text
|
||||
label_3d.text = "too poor"
|
||||
await get_tree().create_timer(2.0).timeout
|
||||
label_3d.text = original_text
|
||||
|
||||
func vend():
|
||||
var item_vend = item.instantiate()
|
||||
@@ -36,4 +36,5 @@ func vend():
|
||||
item_vend.transform.basis = vend_ray.global_transform.basis
|
||||
item_vend.linear_velocity += vend_ray.global_transform.basis * Vector3(0,0,3)
|
||||
active = false
|
||||
label_3d.text = "offline"
|
||||
get_parent().add_child(item_vend)
|
||||
|
||||
Reference in New Issue
Block a user