Merge remote-tracking branch 'refs/remotes/origin/master'
This commit is contained in:
commit
bc8850b67d
|
@ -45,14 +45,16 @@ var inertia = 20
|
|||
|
||||
var game_settings
|
||||
var client_settings
|
||||
#var current_weapon = Weapons["knife"]
|
||||
var can_shoot = true
|
||||
var time_since_last_shot = 0
|
||||
|
||||
@onready var head = $Head
|
||||
@onready var camera: Camera3D = $Head/Camera
|
||||
@onready var playerCharacterBody = $"."
|
||||
|
||||
var HUD
|
||||
var healthBar
|
||||
var healthLabel
|
||||
var armorLabel
|
||||
var ammoLabel
|
||||
var magazineLabel
|
||||
var statusLabel
|
||||
|
@ -70,9 +72,10 @@ func set_property(key, value):
|
|||
update_state()
|
||||
|
||||
func update_hud():
|
||||
healthBar.value = properties["HP"]
|
||||
ammoLabel.text = "Ammo: " + str(properties["current_weapon"]["ammo"])
|
||||
magazineLabel.text = "Magazine: " + str(properties["current_weapon"]["magazine"])
|
||||
healthLabel.text = str(properties["HP"])
|
||||
armorLabel.text = str(properties["AP"])
|
||||
ammoLabel.text = str(properties["current_weapon"]["ammo"])
|
||||
magazineLabel.text = str(properties["current_weapon"]["magazine"])
|
||||
if (properties["reloading"]):
|
||||
statusLabel.text = "Reloading..."
|
||||
else:
|
||||
|
@ -111,9 +114,12 @@ func update_state():
|
|||
add_child(hud)
|
||||
|
||||
HUD = $"HUD"
|
||||
healthBar = HUD.get_node("HealthBar")
|
||||
ammoLabel = HUD.get_node("AmmoDisplay/Ammo")
|
||||
magazineLabel = HUD.get_node("AmmoDisplay/Magazine")
|
||||
var healthAndAmmoDisplay = HUD.get_node("health_and_ammo_display")
|
||||
|
||||
healthLabel = healthAndAmmoDisplay.get_node("healthdisplay/text")
|
||||
armorLabel = healthAndAmmoDisplay.get_node("armordisplay/text")
|
||||
ammoLabel = healthAndAmmoDisplay.get_node("ammodisplay/text")
|
||||
magazineLabel = healthAndAmmoDisplay.get_node("magazinedisplay/text")
|
||||
statusLabel = HUD.get_node("Status")
|
||||
|
||||
playerCharacterBody.up_direction = Vector3.UP;
|
||||
|
@ -188,7 +194,6 @@ func _physics_process(delta):
|
|||
if (multiplayer.multiplayer_peer == null):
|
||||
properties["is_playable"] = false
|
||||
|
||||
healthBar.value = properties["HP"]
|
||||
if Input.is_action_pressed("shoot"):
|
||||
try_shoot()
|
||||
|
||||
|
@ -244,7 +249,6 @@ func sync_puppet(i_id, p, rot):
|
|||
func set_hp(hp):
|
||||
if (!properties["is_playable"]): return
|
||||
properties["HP"] = hp
|
||||
healthBar.value = properties["HP"]
|
||||
|
||||
@rpc ("authority", "call_remote", "reliable")
|
||||
func set_game_settings(s):
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bmuo2tbe3r8ih"
|
||||
path="res://.godot/imported/ammo.svg-a48c5afd8ec441778c292a61a489df3b.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://textures/logo/ammo.svg"
|
||||
dest_files=["res://.godot/imported/ammo.svg-a48c5afd8ec441778c292a61a489df3b.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
|
@ -0,0 +1,37 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://na1y6c7osyj2"
|
||||
path="res://.godot/imported/health.svg-34f0f55daee51496769c12bd4e69bb8d.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://textures/logo/health.svg"
|
||||
dest_files=["res://.godot/imported/health.svg-34f0f55daee51496769c12bd4e69bb8d.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
|
@ -0,0 +1,37 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://d1i1fgjbpwped"
|
||||
path="res://.godot/imported/magazine.svg-87874fb5953f9966e3e389fa7ebeb69b.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://textures/logo/magazine.svg"
|
||||
dest_files=["res://.godot/imported/magazine.svg-87874fb5953f9966e3e389fa7ebeb69b.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
|
@ -0,0 +1,37 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cxpljra1na1p8"
|
||||
path="res://.godot/imported/shield.svg-5699a9fcb58857c3f97318f5501bd1f5.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://textures/logo/shield.svg"
|
||||
dest_files=["res://.godot/imported/shield.svg-5699a9fcb58857c3f97318f5501bd1f5.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
Loading…
Reference in New Issue