Worked on #5
This commit is contained in:
parent
4464179fa9
commit
0c2a6bf9ca
14 changed files with 129 additions and 24 deletions
BIN
.DS_Store
vendored
BIN
.DS_Store
vendored
Binary file not shown.
|
@ -28,7 +28,7 @@ func _ready():
|
|||
selfTeddyNode = get_node(selfTeddy)
|
||||
teddyCollider = str(self.get_path()) + '/CollisionShape3D'
|
||||
teddyName = str(self.get_path()) + '/nameLabel'
|
||||
#$nameLabel.set_text(str(Global.playerName))
|
||||
$nameLabel.set_text("")
|
||||
teddyParent = get_node(selfTeddy).get_parent()
|
||||
Global.teddyAuthorityID = teddyAuthority
|
||||
|
||||
|
@ -52,11 +52,15 @@ func _unhandled_input(event):
|
|||
globalscene = scene
|
||||
add_child(scene)
|
||||
elif menuOpen == true:
|
||||
if Input.is_action_just_pressed("menu"):
|
||||
if Global.miniMenuResume == true:
|
||||
menuOpen = false
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||
if globalscene:
|
||||
globalscene.queue_free()
|
||||
Global.miniMenuResume = false
|
||||
elif Global.miniMenuResume == false:
|
||||
if Input.is_action_just_pressed("menu"):
|
||||
menuOpen = false
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||
if globalscene:
|
||||
globalscene.queue_free()
|
||||
|
||||
func _physics_process(delta):
|
||||
if is_multiplayer_authority():
|
||||
|
|
|
@ -25,7 +25,7 @@ func _physics_process(delta):
|
|||
elif body.is_in_group("human"):
|
||||
var playerShot = body.get_multiplayer_authority()
|
||||
print("Bullet hit ", playerShot)
|
||||
#rpc("damage_player", playerShot)
|
||||
rpc("damage_player")
|
||||
rpc_id(playerShot,"take_damage")
|
||||
self.queue_free()
|
||||
elif body.is_in_group("AI"):
|
||||
|
@ -44,9 +44,10 @@ func _on_Shell_body_entered(body):
|
|||
queue_free()
|
||||
|
||||
@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
|
||||
pass # Might use this later, or maybe not, we'll see
|
||||
func damage_player(): # This can be used later to make sure the server and all other peers know the health of all other players
|
||||
self.queue_free()
|
||||
|
||||
@rpc("any_peer", "call_remote")
|
||||
func take_damage():
|
||||
Global.playerHealth = Global.playerHealth - 10
|
||||
var damage = RandomNumberGenerator.new().randf_range(7.0, 16.0)
|
||||
Global.playerHealth = Global.playerHealth - damage
|
||||
|
|
|
@ -4,15 +4,16 @@ importer="texture"
|
|||
type="CompressedTexture2D"
|
||||
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={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"imported_formats": ["s3tc_bptc", "etc2_astc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
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.s3tc.ctex", "res://.godot/imported/Wood050_2K_Color.jpg-e6185de0fa12ff4588e435b3845fb87e.etc2.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
|
|
|
@ -4,15 +4,16 @@ importer="texture"
|
|||
type="CompressedTexture2D"
|
||||
uid="uid://cmhq2gjngssxg"
|
||||
path.s3tc="res://.godot/imported/newplaster.jpg-c0159d01e1a6adffe0c3bf5b8dcfc7a7.s3tc.ctex"
|
||||
path.etc2="res://.godot/imported/newplaster.jpg-c0159d01e1a6adffe0c3bf5b8dcfc7a7.etc2.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"imported_formats": ["s3tc_bptc", "etc2_astc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
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.s3tc.ctex", "res://.godot/imported/newplaster.jpg-c0159d01e1a6adffe0c3bf5b8dcfc7a7.etc2.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
|
|
|
@ -4,8 +4,9 @@ importer="texture"
|
|||
type="CompressedTexture2D"
|
||||
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={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"imported_formats": ["s3tc_bptc", "etc2_astc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
generator_parameters={}
|
||||
|
@ -13,7 +14,7 @@ generator_parameters={}
|
|||
[deps]
|
||||
|
||||
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.s3tc.ctex", "res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_Wood050_2K_Color.png-09e60c6431251b5cdad5e7603ca8ef91.etc2.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
|
|
|
@ -4,8 +4,9 @@ importer="texture"
|
|||
type="CompressedTexture2D"
|
||||
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={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"imported_formats": ["s3tc_bptc", "etc2_astc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
generator_parameters={}
|
||||
|
@ -13,7 +14,7 @@ generator_parameters={}
|
|||
[deps]
|
||||
|
||||
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.s3tc.ctex", "res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_newplaster.png-56bf5185a878e2d32e5a25ec8c8517fb.etc2.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
|
|
|
@ -4,8 +4,9 @@ importer="texture"
|
|||
type="CompressedTexture2D"
|
||||
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={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"imported_formats": ["s3tc_bptc", "etc2_astc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
generator_parameters={}
|
||||
|
@ -13,7 +14,7 @@ generator_parameters={}
|
|||
[deps]
|
||||
|
||||
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.s3tc.ctex", "res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_windows_xp_bliss-wide.png-c0ea880c9d43e5d1d8d800dd069f83dd.etc2.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
|
|
|
@ -4,15 +4,16 @@ importer="texture"
|
|||
type="CompressedTexture2D"
|
||||
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={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"imported_formats": ["s3tc_bptc", "etc2_astc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
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.s3tc.ctex", "res://.godot/imported/windows_xp_bliss-wide.jpg-b027b98d80d6be8ceaca628f4dcf54ce.etc2.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
|
|
|
@ -4,15 +4,16 @@ importer="texture"
|
|||
type="CompressedTexture2D"
|
||||
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={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"imported_formats": ["s3tc_bptc", "etc2_astc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
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.s3tc.ctex", "res://.godot/imported/woodfloor4k.jpg.001.jpg-e2bdf4950350ecebed41e5db675a15f9.etc2.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
|
|
|
@ -74,3 +74,7 @@ console_send={
|
|||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194309,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[rendering]
|
||||
|
||||
textures/vram_compression/import_s3tc_bptc=true
|
||||
|
|
|
@ -35,3 +35,91 @@ value = 100.0
|
|||
position = Vector2(575, 323)
|
||||
scale = Vector2(0.0351562, 0.0351562)
|
||||
texture = ExtResource("2_5dvrx")
|
||||
|
||||
[node name="Panel" type="Panel" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 8.0
|
||||
offset_top = 9.0
|
||||
offset_right = 147.0
|
||||
offset_bottom = 245.0
|
||||
|
||||
[node name="player1Label" type="Label" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 15.0
|
||||
offset_top = 11.0
|
||||
offset_right = 136.0
|
||||
offset_bottom = 37.0
|
||||
text = "Player 1: 0"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="player2Label" type="Label" parent="."]
|
||||
offset_left = 15.0
|
||||
offset_top = 34.0
|
||||
offset_right = 136.0
|
||||
offset_bottom = 60.0
|
||||
text = "Player 2: 0"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="player3Label" type="Label" parent="."]
|
||||
offset_left = 15.0
|
||||
offset_top = 57.0
|
||||
offset_right = 136.0
|
||||
offset_bottom = 83.0
|
||||
text = "Player 3: 0"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="player4Label" type="Label" parent="."]
|
||||
offset_left = 15.0
|
||||
offset_top = 80.0
|
||||
offset_right = 136.0
|
||||
offset_bottom = 106.0
|
||||
text = "Player 4: 0"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="player5Label" type="Label" parent="."]
|
||||
offset_left = 15.0
|
||||
offset_top = 103.0
|
||||
offset_right = 136.0
|
||||
offset_bottom = 129.0
|
||||
text = "Player 5: 0"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="player6Label" type="Label" parent="."]
|
||||
offset_left = 15.0
|
||||
offset_top = 126.0
|
||||
offset_right = 136.0
|
||||
offset_bottom = 152.0
|
||||
text = "Player 6: 0"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="player7Label" type="Label" parent="."]
|
||||
offset_left = 15.0
|
||||
offset_top = 149.0
|
||||
offset_right = 136.0
|
||||
offset_bottom = 175.0
|
||||
text = "Player 7: 0"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="player8Label" type="Label" parent="."]
|
||||
offset_left = 15.0
|
||||
offset_top = 172.0
|
||||
offset_right = 136.0
|
||||
offset_bottom = 198.0
|
||||
text = "Player 8: 0"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="player9Label" type="Label" parent="."]
|
||||
offset_left = 15.0
|
||||
offset_top = 195.0
|
||||
offset_right = 136.0
|
||||
offset_bottom = 221.0
|
||||
text = "Player 9: 0"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="player10Label" type="Label" parent="."]
|
||||
offset_left = 15.0
|
||||
offset_top = 218.0
|
||||
offset_right = 145.0
|
||||
offset_bottom = 244.0
|
||||
text = "Player 10: 0"
|
||||
horizontal_alignment = 1
|
||||
|
|
|
@ -18,6 +18,7 @@ var selfTeddy # Defined as soon as the player script is initalized
|
|||
var multiplayerCurrent = false # Whether the player is using multiplayer
|
||||
var currentMapNode # Defined in map scripts
|
||||
var teddyAuthorityID # Defined from teddy.gd after object is initalized
|
||||
var miniMenuResume = false # Set to true by mainmenu.gd
|
||||
|
||||
func _process(delta):
|
||||
if godMode:
|
||||
|
|
|
@ -17,7 +17,7 @@ func _on_button_pressed():
|
|||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||
elif Global.playingGame == true:
|
||||
self.queue_free()
|
||||
Global.menuOpen = false
|
||||
Global.miniMenuResume = true
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||
|
||||
func _on_button_2_pressed():
|
||||
|
|
Loading…
Reference in a new issue