'Fixed' damage bug #3

This commit is contained in:
Paul Black 2023-02-28 09:46:35 -07:00
parent 71b669eb44
commit 3c90b71e12
10 changed files with 35 additions and 24 deletions

View file

@ -25,7 +25,9 @@ func _physics_process(delta):
elif body.is_in_group("human"): elif body.is_in_group("human"):
var playerShot = body.get_multiplayer_authority() var playerShot = body.get_multiplayer_authority()
print("Bullet hit ", playerShot) print("Bullet hit ", playerShot)
rpc("damage_player", playerShot) #rpc("damage_player", playerShot)
rpc_id(playerShot,"take_damage")
self.queue_free()
elif body.is_in_group("AI"): elif body.is_in_group("AI"):
print("Bullet hit an AI player") print("Bullet hit an AI player")
body.queue_free() body.queue_free()
@ -43,8 +45,7 @@ func _on_Shell_body_entered(body):
@rpc("any_peer", "call_remote", "reliable") @rpc("any_peer", "call_remote", "reliable")
func damage_player(playerDamaged): # This can be used later to make sure the server and all other peers know the health of all other players func damage_player(playerDamaged): # This can be used later to make sure the server and all other peers know the health of all other players
rpc_id(playerDamaged,"take_damage") pass # Might use this later, or maybe not, we'll see
self.queue_free()
@rpc("any_peer", "call_remote") @rpc("any_peer", "call_remote")
func take_damage(): func take_damage():

View file

@ -3,16 +3,16 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://dnobq0anmbln8" uid="uid://dnobq0anmbln8"
path.s3tc="res://.godot/imported/Wood050_2K_Color.jpg-e6185de0fa12ff4588e435b3845fb87e.s3tc.ctex" path.etc2="res://.godot/imported/Wood050_2K_Color.jpg-e6185de0fa12ff4588e435b3845fb87e.etc2.ctex"
metadata={ metadata={
"imported_formats": ["s3tc_bptc"], "imported_formats": ["etc2_astc"],
"vram_texture": true "vram_texture": true
} }
[deps] [deps]
source_file="res://objects/toyland/Wood050_2K_Color.jpg" source_file="res://objects/toyland/Wood050_2K_Color.jpg"
dest_files=["res://.godot/imported/Wood050_2K_Color.jpg-e6185de0fa12ff4588e435b3845fb87e.s3tc.ctex"] dest_files=["res://.godot/imported/Wood050_2K_Color.jpg-e6185de0fa12ff4588e435b3845fb87e.etc2.ctex"]
[params] [params]

View file

@ -3,16 +3,16 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://cmhq2gjngssxg" uid="uid://cmhq2gjngssxg"
path.s3tc="res://.godot/imported/newplaster.jpg-c0159d01e1a6adffe0c3bf5b8dcfc7a7.s3tc.ctex" path.etc2="res://.godot/imported/newplaster.jpg-c0159d01e1a6adffe0c3bf5b8dcfc7a7.etc2.ctex"
metadata={ metadata={
"imported_formats": ["s3tc_bptc"], "imported_formats": ["etc2_astc"],
"vram_texture": true "vram_texture": true
} }
[deps] [deps]
source_file="res://objects/toyland/newplaster.jpg" source_file="res://objects/toyland/newplaster.jpg"
dest_files=["res://.godot/imported/newplaster.jpg-c0159d01e1a6adffe0c3bf5b8dcfc7a7.s3tc.ctex"] dest_files=["res://.godot/imported/newplaster.jpg-c0159d01e1a6adffe0c3bf5b8dcfc7a7.etc2.ctex"]
[params] [params]

View file

@ -3,9 +3,9 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://c4brgjvonnjkr" uid="uid://c4brgjvonnjkr"
path.s3tc="res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_Wood050_2K_Color.png-09e60c6431251b5cdad5e7603ca8ef91.s3tc.ctex" path.etc2="res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_Wood050_2K_Color.png-09e60c6431251b5cdad5e7603ca8ef91.etc2.ctex"
metadata={ metadata={
"imported_formats": ["s3tc_bptc"], "imported_formats": ["etc2_astc"],
"vram_texture": true "vram_texture": true
} }
generator_parameters={} generator_parameters={}
@ -13,7 +13,7 @@ generator_parameters={}
[deps] [deps]
source_file="res://objects/toyland/toyland-acc3ec7302587eef6111479be4ff2e5f_Wood050_2K_Color.png" source_file="res://objects/toyland/toyland-acc3ec7302587eef6111479be4ff2e5f_Wood050_2K_Color.png"
dest_files=["res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_Wood050_2K_Color.png-09e60c6431251b5cdad5e7603ca8ef91.s3tc.ctex"] dest_files=["res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_Wood050_2K_Color.png-09e60c6431251b5cdad5e7603ca8ef91.etc2.ctex"]
[params] [params]

View file

@ -3,9 +3,9 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://ql40b60xucke" uid="uid://ql40b60xucke"
path.s3tc="res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_newplaster.png-56bf5185a878e2d32e5a25ec8c8517fb.s3tc.ctex" path.etc2="res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_newplaster.png-56bf5185a878e2d32e5a25ec8c8517fb.etc2.ctex"
metadata={ metadata={
"imported_formats": ["s3tc_bptc"], "imported_formats": ["etc2_astc"],
"vram_texture": true "vram_texture": true
} }
generator_parameters={} generator_parameters={}
@ -13,7 +13,7 @@ generator_parameters={}
[deps] [deps]
source_file="res://objects/toyland/toyland-acc3ec7302587eef6111479be4ff2e5f_newplaster.png" source_file="res://objects/toyland/toyland-acc3ec7302587eef6111479be4ff2e5f_newplaster.png"
dest_files=["res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_newplaster.png-56bf5185a878e2d32e5a25ec8c8517fb.s3tc.ctex"] dest_files=["res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_newplaster.png-56bf5185a878e2d32e5a25ec8c8517fb.etc2.ctex"]
[params] [params]

View file

@ -3,9 +3,9 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://cj28kq4i36gcg" uid="uid://cj28kq4i36gcg"
path.s3tc="res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_windows_xp_bliss-wide.png-c0ea880c9d43e5d1d8d800dd069f83dd.s3tc.ctex" path.etc2="res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_windows_xp_bliss-wide.png-c0ea880c9d43e5d1d8d800dd069f83dd.etc2.ctex"
metadata={ metadata={
"imported_formats": ["s3tc_bptc"], "imported_formats": ["etc2_astc"],
"vram_texture": true "vram_texture": true
} }
generator_parameters={} generator_parameters={}
@ -13,7 +13,7 @@ generator_parameters={}
[deps] [deps]
source_file="res://objects/toyland/toyland-acc3ec7302587eef6111479be4ff2e5f_windows_xp_bliss-wide.png" source_file="res://objects/toyland/toyland-acc3ec7302587eef6111479be4ff2e5f_windows_xp_bliss-wide.png"
dest_files=["res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_windows_xp_bliss-wide.png-c0ea880c9d43e5d1d8d800dd069f83dd.s3tc.ctex"] dest_files=["res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_windows_xp_bliss-wide.png-c0ea880c9d43e5d1d8d800dd069f83dd.etc2.ctex"]
[params] [params]

View file

@ -3,16 +3,16 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://co6sxyhce6s7" uid="uid://co6sxyhce6s7"
path.s3tc="res://.godot/imported/windows_xp_bliss-wide.jpg-b027b98d80d6be8ceaca628f4dcf54ce.s3tc.ctex" path.etc2="res://.godot/imported/windows_xp_bliss-wide.jpg-b027b98d80d6be8ceaca628f4dcf54ce.etc2.ctex"
metadata={ metadata={
"imported_formats": ["s3tc_bptc"], "imported_formats": ["etc2_astc"],
"vram_texture": true "vram_texture": true
} }
[deps] [deps]
source_file="res://objects/toyland/windows_xp_bliss-wide.jpg" source_file="res://objects/toyland/windows_xp_bliss-wide.jpg"
dest_files=["res://.godot/imported/windows_xp_bliss-wide.jpg-b027b98d80d6be8ceaca628f4dcf54ce.s3tc.ctex"] dest_files=["res://.godot/imported/windows_xp_bliss-wide.jpg-b027b98d80d6be8ceaca628f4dcf54ce.etc2.ctex"]
[params] [params]

View file

@ -3,16 +3,16 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://b6f2baaxv23qx" uid="uid://b6f2baaxv23qx"
path.s3tc="res://.godot/imported/woodfloor4k.jpg.001.jpg-e2bdf4950350ecebed41e5db675a15f9.s3tc.ctex" path.etc2="res://.godot/imported/woodfloor4k.jpg.001.jpg-e2bdf4950350ecebed41e5db675a15f9.etc2.ctex"
metadata={ metadata={
"imported_formats": ["s3tc_bptc"], "imported_formats": ["etc2_astc"],
"vram_texture": true "vram_texture": true
} }
[deps] [deps]
source_file="res://objects/toyland/woodfloor4k.jpg.001.jpg" source_file="res://objects/toyland/woodfloor4k.jpg.001.jpg"
dest_files=["res://.godot/imported/woodfloor4k.jpg.001.jpg-e2bdf4950350ecebed41e5db675a15f9.s3tc.ctex"] dest_files=["res://.godot/imported/woodfloor4k.jpg.001.jpg-e2bdf4950350ecebed41e5db675a15f9.etc2.ctex"]
[params] [params]

View file

@ -132,12 +132,14 @@ offset_bottom = 187.0
text = "Host Game" text = "Host Game"
[node name="playerNameBox" type="LineEdit" parent="."] [node name="playerNameBox" type="LineEdit" parent="."]
layout_mode = 0
offset_left = 392.0 offset_left = 392.0
offset_top = 527.0 offset_top = 527.0
offset_right = 559.0 offset_right = 559.0
offset_bottom = 570.0 offset_bottom = 570.0
[node name="playerLabel" type="Label" parent="."] [node name="playerLabel" type="Label" parent="."]
layout_mode = 0
offset_left = 269.0 offset_left = 269.0
offset_top = 536.0 offset_top = 536.0
offset_right = 377.0 offset_right = 377.0

View file

@ -120,6 +120,14 @@ position = Vector2(155.115, 42.25)
scale = Vector2(0.344017, 0.344017) scale = Vector2(0.344017, 0.344017)
texture = ExtResource("8_h20ni") texture = ExtResource("8_h20ni")
[node name="versionString" type="Label" parent="."]
layout_mode = 0
offset_left = 4.0
offset_top = 622.0
offset_right = 94.0
offset_bottom = 648.0
text = "Version: 0.5"
[connection signal="pressed" from="Button" to="." method="_on_button_pressed"] [connection signal="pressed" from="Button" to="." method="_on_button_pressed"]
[connection signal="mouse_entered" from="playButton" to="." method="_on_play_button_mouse_entered"] [connection signal="mouse_entered" from="playButton" to="." method="_on_play_button_mouse_entered"]
[connection signal="mouse_exited" from="playButton" to="." method="_on_play_button_mouse_exited"] [connection signal="mouse_exited" from="playButton" to="." method="_on_play_button_mouse_exited"]