substantial work on saving and loading and hub mechanic
This commit is contained in:
@@ -84,20 +84,20 @@ func _process(delta: float) -> void:
|
||||
gun_info.visible = true
|
||||
|
||||
#HEALTH
|
||||
health_bar.value = level_control.health
|
||||
if level_control.health <= 2:
|
||||
health_bar.value = GameGlobals.health
|
||||
if GameGlobals.health <= 2:
|
||||
change_color(health_bar,RED_COLOR,10,delta)
|
||||
health_bar.position = health_bar_start_pos + shake_element(15)
|
||||
elif level_control.health < ((level_control.gamemode.start_health / 2) + 1):
|
||||
elif GameGlobals.health < ((level_control.gamemode.start_health / 2) + 1):
|
||||
change_color(health_bar,ORANGE_COLOR,10,delta)
|
||||
else:
|
||||
change_color(health_bar,FULL_WHITE,10,delta)
|
||||
|
||||
#MONEY
|
||||
if money_count < level_control.money:
|
||||
if money_count < int(GameGlobals.money):
|
||||
money_count += 1
|
||||
change_color(money,GREEN_COLOR,10,delta)
|
||||
elif money_count > level_control.money:
|
||||
elif money_count > int(GameGlobals.money):
|
||||
change_color(money,RED_COLOR,10,delta)
|
||||
money_count -= 1
|
||||
else:
|
||||
@@ -111,12 +111,12 @@ func _process(delta: float) -> void:
|
||||
current_stam_bar.value = player.remaining_stamina
|
||||
|
||||
if player.gun != null:
|
||||
if player.gun_ammo.has(player.gun.gun_name):
|
||||
ammo_current.text = str(player.gun_ammo[player.gun.gun_name]).pad_zeros(2)
|
||||
lerp_color(ammo_current,RED_COLOR,FULL_WHITE,player.gun_ammo[player.gun.gun_name],player.gun.max_ammo,.5)
|
||||
if player.ammo_reserve.has(str(player.gun.ammo_type)):
|
||||
ammo_reserve.text = str(player.ammo_reserve[str(player.gun.ammo_type)]).pad_zeros(3)
|
||||
lerp_color(ammo_reserve,RED_COLOR,FULL_WHITE,player.ammo_reserve[str(player.gun.ammo_type)],player.gun.max_ammo*2,.5)
|
||||
if GameGlobals.gun_ammo.has(player.gun.gun_name):
|
||||
ammo_current.text = str(GameGlobals.gun_ammo[player.gun.gun_name]).pad_zeros(2)
|
||||
lerp_color(ammo_current,RED_COLOR,FULL_WHITE,GameGlobals.gun_ammo[player.gun.gun_name],player.gun.max_ammo,.5)
|
||||
if GameGlobals.ammo_reserve.has(str(player.gun.ammo_type)):
|
||||
ammo_reserve.text = str(GameGlobals.ammo_reserve[str(player.gun.ammo_type)]).pad_zeros(3)
|
||||
lerp_color(ammo_reserve,RED_COLOR,FULL_WHITE,GameGlobals.ammo_reserve[str(player.gun.ammo_type)],player.gun.max_ammo*2,.5)
|
||||
else:
|
||||
fade_in_out(ammo_current,1,false,10,delta)
|
||||
fade_in_out(ammo_reserve,1,false,10,delta)
|
||||
|
||||
Reference in New Issue
Block a user