This commit is contained in:
akshay committed 2022-08-14 04:57:32 -04:00
commit 2874c11658
12 files changed
+146 -6

No files matched your search

+14
View File
@@ -4,6 +4,7 @@ const EPSILON = 0.0001
const SPEED = 3.0
export var inventory = { "ore" : 0 }
var health: int = 4 setget set_health
var item_in_hand
@@ -18,6 +19,19 @@ func _physics_process(delta):
$DungMan.look_at(global_transform.origin - motion, Vector3.UP)
move_and_slide(motion)
func set_health(new_value):
health = min(new_value, 4)
for child in $"%stomachs".get_children():
child.visible = child.get_index() < health
if health <= 0:
var node = Dialogic.start("starve")
node.pause_mode = PAUSE_MODE_PROCESS
add_child(node)
get_tree().paused = true
yield(node, "timeline_end")
get_tree().paused = false
get_tree().quit() # go back to main menu when such a thing exists
func can_afford(item_name, item_amount):
assert(item_amount > 0)
var current_amount : int = 0
+1
View File
@@ -21,6 +21,7 @@ func _on_Timer_timeout():
func _on_yam_item_tree_exited():
$coin_machine.enabled = true
$MeshInstance/Yam.visible = false
add_child(Dialogic.start("yamget"))
func _process(delta):
$"%status_label".text = "%f" % $grow_timer.time_left