tweaked vending machine and added on off to boombox
This commit is contained in:
@@ -17,14 +17,16 @@ func _ready():
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
pass
|
||||
if active == false:
|
||||
while item_price > 0:
|
||||
item_price = lerp(int(item_price),int(0),delta * .01)
|
||||
label_3d.text = "$" + str(item_price)
|
||||
|
||||
func interact():
|
||||
if active == true:
|
||||
if level_control.money >= item_price:
|
||||
level_control.money -= item_price
|
||||
anim_player.play("vend")
|
||||
#label_3d.text = str(lerp(item_price,0,delta))
|
||||
else:
|
||||
pass #add "too poor" text here
|
||||
|
||||
@@ -32,6 +34,6 @@ func vend():
|
||||
var item_vend = item.instantiate()
|
||||
item_vend.position = vend_ray.global_position
|
||||
item_vend.transform.basis = vend_ray.global_transform.basis
|
||||
item_vend.linear_velocity += vend_ray.global_transform.basis * Vector3(0,0,10)
|
||||
item_vend.linear_velocity += vend_ray.global_transform.basis * Vector3(0,0,3)
|
||||
active = false
|
||||
get_parent().add_child(item_vend)
|
||||
|
||||
Reference in New Issue
Block a user