FERTIG!!!
This commit is contained in:
parent
1ae6aad011
commit
5a2df93eb4
5 changed files with 72 additions and 57 deletions
55
main.gd
55
main.gd
|
@ -9,15 +9,16 @@ var checkpoint2 = Vector3(0, 22, 1.374)
|
|||
var checkpoint3 = Vector3(-50, 25, -5)
|
||||
var terminus = Vector3(-8, -8.5, 9.5)
|
||||
var checkpoint = checkpoint0
|
||||
@onready var checkpointtext = $Label_Station
|
||||
@onready var checkpointtext = $MarginContainer/HBoxContainer/VBoxContainer/Label_Station
|
||||
var time_accum = 0.0 # Timer accumulator
|
||||
@onready var player = get_node("Player")
|
||||
var elapsed_time := 0.0
|
||||
var restart_count = 0
|
||||
@onready var healthtext = $MarginContainer/HBoxContainer2/Label_Health
|
||||
|
||||
func _ready() -> void:
|
||||
var player = get_node("Player")
|
||||
$Label_Station.text = "station 0"
|
||||
checkpointtext.text = "station 0"
|
||||
# while true:
|
||||
# wait(5)
|
||||
# print(player.checkpoint)
|
||||
|
@ -49,44 +50,44 @@ func _process(delta: float):
|
|||
elif Input.is_action_just_pressed("proluz_ui_reset"):
|
||||
get_tree().reload_current_scene()
|
||||
var player = get_node("Player")
|
||||
$Label_Controls2.text = get_formatted_time()
|
||||
$MarginContainer/HBoxContainer/VBoxContainer/Label_Controls2.text = get_formatted_time()
|
||||
# Health bar
|
||||
if player.health == 100:
|
||||
$Label_Health.text = "[//////////]"
|
||||
$Label_Health.add_theme_color_override("font_color", Color.GREEN)
|
||||
healthtext.text = "[//////////]"
|
||||
healthtext.add_theme_color_override("font_color", Color.GREEN)
|
||||
elif player.health >= 90:
|
||||
$Label_Health.text = "[/////////·]"
|
||||
$Label_Health.add_theme_color_override("font_color", Color.GREEN)
|
||||
healthtext.text = "[/////////·]"
|
||||
healthtext.add_theme_color_override("font_color", Color.GREEN)
|
||||
elif player.health >= 80:
|
||||
$Label_Health.text = "[////////··]"
|
||||
$Label_Health.add_theme_color_override("font_color", Color.GREEN)
|
||||
healthtext.text = "[////////··]"
|
||||
healthtext.add_theme_color_override("font_color", Color.GREEN)
|
||||
elif player.health >= 70:
|
||||
$Label_Health.text = "[///////···]"
|
||||
$Label_Health.add_theme_color_override("font_color", Color.GREEN)
|
||||
healthtext.text = "[///////···]"
|
||||
healthtext.add_theme_color_override("font_color", Color.GREEN)
|
||||
elif player.health >= 60:
|
||||
$Label_Health.text = "[//////····]"
|
||||
$Label_Health.add_theme_color_override("font_color", Color.GREEN_YELLOW)
|
||||
healthtext.text = "[//////····]"
|
||||
healthtext.add_theme_color_override("font_color", Color.GREEN_YELLOW)
|
||||
elif player.health >= 50:
|
||||
$Label_Health.text = "[/////·····]"
|
||||
$Label_Health.add_theme_color_override("font_color", Color.GREEN_YELLOW)
|
||||
healthtext.text = "[/////·····]"
|
||||
healthtext.add_theme_color_override("font_color", Color.GREEN_YELLOW)
|
||||
elif player.health >= 40:
|
||||
$Label_Health.text = "[////······]"
|
||||
$Label_Health.add_theme_color_override("font_color", Color.YELLOW)
|
||||
healthtext.text = "[////······]"
|
||||
healthtext.add_theme_color_override("font_color", Color.YELLOW)
|
||||
elif player.health >= 30:
|
||||
$Label_Health.text = "[///·······]"
|
||||
$Label_Health.add_theme_color_override("font_color", Color.YELLOW)
|
||||
healthtext.text = "[///·······]"
|
||||
healthtext.add_theme_color_override("font_color", Color.YELLOW)
|
||||
elif player.health >= 20:
|
||||
$Label_Health.text = "[//········]"
|
||||
$Label_Health.add_theme_color_override("font_color", Color.YELLOW)
|
||||
healthtext.text = "[//········]"
|
||||
healthtext.add_theme_color_override("font_color", Color.YELLOW)
|
||||
elif player.health >= 10:
|
||||
$Label_Health.text = "[/·········]"
|
||||
$Label_Health.add_theme_color_override("font_color", Color.INDIAN_RED)
|
||||
healthtext.text = "[/·········]"
|
||||
healthtext.add_theme_color_override("font_color", Color.INDIAN_RED)
|
||||
elif player.health >= 1:
|
||||
$Label_Health.text = "[|·········][CRITICAL]"
|
||||
$Label_Health.add_theme_color_override("font_color", Color.RED)
|
||||
healthtext.text = "[|·········][CRITICAL]"
|
||||
healthtext.add_theme_color_override("font_color", Color.RED)
|
||||
elif player.health == 0:
|
||||
$Label_Health.text = "[··········][DEAD/Shift+R to revive]"
|
||||
$Label_Health.add_theme_color_override("font_color", Color.MEDIUM_PURPLE)
|
||||
healthtext.text = "[··········][DEAD/Shift+R to revive]"
|
||||
healthtext.add_theme_color_override("font_color", Color.MEDIUM_PURPLE)
|
||||
Engine.time_scale = 0.001
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue