Fixed #14, worked on #16

This commit is contained in:
Paul Black 2023-03-09 13:26:09 -07:00
parent d451c737d8
commit 510b5a53b9
27 changed files with 355 additions and 62 deletions

View file

@ -31,36 +31,39 @@ func _ready():
$nameLabel.set_text("")
teddyParent = get_node(selfTeddy).get_parent()
Global.teddyAuthorityID = teddyAuthority
if is_multiplayer_authority():
$CollisionShape3D/Neck/Teddy.visible = false
func _unhandled_input(event):
Global.selfTeddy = selfTeddy
if event is InputEventMouseButton:
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
elif event.is_action_pressed("ui_cancel"):
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
if event is InputEventMouseMotion:
var mousesense = Global.mouseSensitivity
neck.rotate_y(-event.relative.x * mousesense)
camera.rotate_x(-event.relative.y * mousesense)
camera.rotation.x = clamp(camera.rotation.x, deg_to_rad(-50), deg_to_rad(60))
if menuOpen == false:
if Input.is_action_just_pressed("menu"):
menuOpen = true
var scene_trs = load("res://scenes/mainmenu.tscn")
var scene = scene_trs.instantiate()
globalscene = scene
add_child(scene)
elif menuOpen == true:
if Global.miniMenuResume == true:
menuOpen = false
Global.miniMenuResume = false
elif Global.miniMenuResume == false:
if is_multiplayer_authority():
Global.selfTeddy = selfTeddy
if event is InputEventMouseButton:
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
elif event.is_action_pressed("ui_cancel"):
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
if event is InputEventMouseMotion:
var mousesense = Global.mouseSensitivity
neck.rotate_y(-event.relative.x * mousesense)
camera.rotate_x(-event.relative.y * mousesense)
camera.rotation.x = clamp(camera.rotation.x, deg_to_rad(-50), deg_to_rad(60))
if menuOpen == false:
if Input.is_action_just_pressed("menu"):
menuOpen = true
var scene_trs = load("res://scenes/mainmenu.tscn")
var scene = scene_trs.instantiate()
globalscene = scene
add_child(scene)
elif menuOpen == true:
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():
@ -95,6 +98,8 @@ func _physics_process(delta):
velocity.y = JUMP_VELOCITY
var input_dir = Input.get_vector("player_left", "player_right", "player_forward", "player_backward")
var direction = (neck.transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
if input_dir:
rpc("teddy_walk_anim")
if Input.is_action_pressed("sprint"):
if Global.fatigue > 5:
SPEED = 10.0
@ -139,16 +144,21 @@ func _physics_process(delta):
if teddyAuthority == 1:
Global.roundInSession = true
rpc("round_start")
rpc("remote_set_position", global_position, $CollisionShape3D/Neck/Camera3D/BulletGenerator.global_position, $CollisionShape3D/Neck/Camera3D/BulletGenerator.global_rotation)
rpc("remote_set_position", global_position, $CollisionShape3D/Neck/Teddy.global_rotation.y, $CollisionShape3D/Neck/Camera3D/BulletGenerator.global_position, $CollisionShape3D/Neck/Camera3D/BulletGenerator.global_rotation)
rpc("set_teddy_name", teddyName, Global.playerName)
move_and_slide()
@rpc("any_peer", "unreliable")
func remote_set_position(authority_position, bulletgenerator_position, bulletgenerator_rotation):
func remote_set_position(authority_position, teddy_rotation, bulletgenerator_position, bulletgenerator_rotation):
global_position = authority_position
$CollisionShape3D/Neck/Teddy.rotation.y = teddy_rotation
$CollisionShape3D/Neck/Camera3D/BulletGenerator.global_position = bulletgenerator_position
$CollisionShape3D/Neck/Camera3D/BulletGenerator.global_rotation = bulletgenerator_rotation
@rpc("any_peer", "reliable")
func teddy_walk_anim():
$CollisionShape3D/Neck/Teddy/AnimationPlayer.play("mixamocom")
@rpc("any_peer", "unreliable")
func shoot_bullet():
var b = Bullet.instantiate()

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 MiB

View file

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cro0qy8p8j1nc"
path.etc2="res://.godot/imported/Teddy-de34648a55743de65735b80db47e8535_BrownFabric.png-e262ea1b1791f537d156e62ada10e3d9.etc2.ctex"
metadata={
"imported_formats": ["etc2_astc"],
"vram_texture": true
}
generator_parameters={}
[deps]
source_file="res://characters/teddy/model/Teddy-de34648a55743de65735b80db47e8535_BrownFabric.png"
dest_files=["res://.godot/imported/Teddy-de34648a55743de65735b80db47e8535_BrownFabric.png-e262ea1b1791f537d156e62ada10e3d9.etc2.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
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=0

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 MiB

View file

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://t4uhkvweq55l"
path.etc2="res://.godot/imported/Teddy-de34648a55743de65735b80db47e8535_BrownFabricBelly.png-f48e4aaa79e2a0cf3814c7dbef28823a.etc2.ctex"
metadata={
"imported_formats": ["etc2_astc"],
"vram_texture": true
}
generator_parameters={}
[deps]
source_file="res://characters/teddy/model/Teddy-de34648a55743de65735b80db47e8535_BrownFabricBelly.png"
dest_files=["res://.godot/imported/Teddy-de34648a55743de65735b80db47e8535_BrownFabricBelly.png-f48e4aaa79e2a0cf3814c7dbef28823a.etc2.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
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=0

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 MiB

View file

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c1fr5ak803h0k"
path.etc2="res://.godot/imported/Teddy-de34648a55743de65735b80db47e8535_FabricNose.png-12c7438645ca0861b049ecee40b0b65c.etc2.ctex"
metadata={
"imported_formats": ["etc2_astc"],
"vram_texture": true
}
generator_parameters={}
[deps]
source_file="res://characters/teddy/model/Teddy-de34648a55743de65735b80db47e8535_FabricNose.png"
dest_files=["res://.godot/imported/Teddy-de34648a55743de65735b80db47e8535_FabricNose.png-12c7438645ca0861b049ecee40b0b65c.etc2.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
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=0

Binary file not shown.

After

Width:  |  Height:  |  Size: 7 MiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c35o1oqul5qlr"
path="res://.godot/imported/BrownFabric.jpg-d8f82695d2eb76de4b392506455a734b.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://characters/teddy/model/Teddy.fbm/BrownFabric.jpg"
dest_files=["res://.godot/imported/BrownFabric.jpg-d8f82695d2eb76de4b392506455a734b.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 MiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ctlxadgx0cn3j"
path="res://.godot/imported/BrownFabricBelly.jpg-3fd756cbff8cbae88c9e7d8582334dfb.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://characters/teddy/model/Teddy.fbm/BrownFabricBelly.jpg"
dest_files=["res://.godot/imported/BrownFabricBelly.jpg-3fd756cbff8cbae88c9e7d8582334dfb.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 MiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://2a8u5usfhtiq"
path="res://.godot/imported/FabricNose.jpg-2afdefd44b1999f46c6b963e27d219c0.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://characters/teddy/model/Teddy.fbm/FabricNose.jpg"
dest_files=["res://.godot/imported/FabricNose.jpg-2afdefd44b1999f46c6b963e27d219c0.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

Binary file not shown.

View file

@ -0,0 +1,32 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://dx1c1lbnl5fmh"
path="res://.godot/imported/Teddy.fbx-de34648a55743de65735b80db47e8535.scn"
[deps]
source_file="res://characters/teddy/model/Teddy.fbx"
dest_files=["res://.godot/imported/Teddy.fbx-de34648a55743de65735b80db47e8535.scn"]
[params]
nodes/root_type="Node3D"
nodes/root_name="Scene Root"
nodes/apply_root_scale=true
nodes/root_scale=1.0
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/embedded_image_handling=1

View file

@ -0,0 +1,28 @@
[gd_scene load_steps=2 format=3 uid="uid://gw6tb1oyx3vj"]
[ext_resource type="PackedScene" path="res://characters/teddy/model/Teddy.fbx" id="1_fiiw5"]
[node name="Teddy" instance=ExtResource("1_fiiw5")]
[node name="Skeleton3D" parent="RootNode" index="0"]
bones/0/position = Vector3(0.0311831, 1.77793, -0.0275337)
bones/0/rotation = Quaternion(0.00679465, 0.999708, 0.00868269, -0.0215002)
bones/1/rotation = Quaternion(0.00188424, 0.00512121, 0.00409826, 0.999977)
bones/2/rotation = Quaternion(-0.00338569, 0.00599611, -0.0044001, 0.999967)
bones/3/rotation = Quaternion(-0.0033857, 0.00599611, -0.0044001, 0.999967)
bones/4/rotation = Quaternion(-0.00361889, -0.00394132, 0.0105565, 0.99993)
bones/5/rotation = Quaternion(-0.0235006, -0.0268053, -0.0160073, 0.999236)
bones/7/rotation = Quaternion(0.521376, -0.410921, 0.672194, 0.327821)
bones/8/rotation = Quaternion(0.24328, -0.0588707, -0.0256803, 0.967827)
bones/9/rotation = Quaternion(0.0770526, 0.113304, 0.298361, 0.944566)
bones/11/rotation = Quaternion(-0.557731, -0.38403, 0.648654, -0.347427)
bones/12/rotation = Quaternion(-0.235556, 0.879681, 0.209497, -0.356069)
bones/13/rotation = Quaternion(-0.222151, -0.0881404, 0.121091, 0.96344)
bones/15/rotation = Quaternion(0.0683854, -0.125366, 0.9896, 0.0173049)
bones/16/rotation = Quaternion(0.617154, 0.00547633, -0.0283807, 0.786311)
bones/17/rotation = Quaternion(0.00667534, -0.332962, 0.942779, 0.0161204)
bones/18/rotation = Quaternion(0.018142, 0.952996, -0.302437, 0.00117584)
bones/20/rotation = Quaternion(-0.0711955, -0.075447, 0.993807, 0.039842)
bones/21/rotation = Quaternion(0.121044, -0.0730026, 0.0224523, 0.989704)
bones/22/rotation = Quaternion(0.0266432, -0.591498, 0.804726, -0.0428458)
bones/23/rotation = Quaternion(-0.126814, 0.00228145, 0.00129951, 0.991923)

View file

@ -3,16 +3,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": ["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.etc2.ctex"]
[params]

View file

@ -3,16 +3,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": ["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.etc2.ctex"]
[params]

View file

@ -3,9 +3,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": ["etc2_astc"],
"vram_texture": true
}
generator_parameters={}
@ -13,7 +13,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.etc2.ctex"]
[params]

View file

@ -3,9 +3,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": ["etc2_astc"],
"vram_texture": true
}
generator_parameters={}
@ -13,7 +13,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.etc2.ctex"]
[params]

View file

@ -3,9 +3,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": ["etc2_astc"],
"vram_texture": true
}
generator_parameters={}
@ -13,7 +13,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.etc2.ctex"]
[params]

View file

@ -3,16 +3,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": ["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.etc2.ctex"]
[params]

View file

@ -3,16 +3,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": ["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.etc2.ctex"]
[params]

View file

@ -1,6 +1,7 @@
[gd_scene load_steps=4 format=3 uid="uid://dp1q51kvd8uow"]
[gd_scene load_steps=5 format=3 uid="uid://dp1q51kvd8uow"]
[ext_resource type="Script" path="res://characters/teddy/Teddy.gd" id="1_ywxo5"]
[ext_resource type="PackedScene" uid="uid://gw6tb1oyx3vj" path="res://characters/teddy/model_scene/teddy.tscn" id="2_63i6c"]
[sub_resource type="BoxShape3D" id="BoxShape3D_rpt2n"]
size = Vector3(1, 1.99126, 1)
@ -14,6 +15,7 @@ script = ExtResource("1_ywxo5")
shape = SubResource("BoxShape3D_rpt2n")
[node name="MeshInstance3D" type="MeshInstance3D" parent="CollisionShape3D"]
visible = false
mesh = SubResource("CapsuleMesh_qq44a")
skeleton = NodePath("../..")
@ -25,6 +27,9 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.859224, 0)
[node name="BulletGenerator" type="Marker3D" parent="CollisionShape3D/Neck/Camera3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.104801, -0.858231)
[node name="Teddy" parent="CollisionShape3D/Neck" instance=ExtResource("2_63i6c")]
transform = Transform3D(-0.319764, 1.11529e-16, -2.79546e-08, 1.11529e-16, 0.319764, -1.11529e-16, 2.79546e-08, -1.11529e-16, -0.319764, 2.08165e-12, -1.90215, 2.08165e-12)
[node name="sound" type="AudioStreamPlayer3D" parent="."]
[node name="nameLabel" type="Label3D" parent="."]

View file

@ -156,6 +156,7 @@ offset_bottom = 479.0
text = "Short"
[node name="normalRespawn" type="CheckBox" parent="."]
layout_mode = 0
offset_left = 673.0
offset_top = 447.0
offset_right = 760.0
@ -164,6 +165,7 @@ button_pressed = true
text = "Normal"
[node name="longRespawn" type="CheckBox" parent="."]
layout_mode = 0
offset_left = 763.0
offset_top = 447.0
offset_right = 830.0

View file

@ -38,18 +38,21 @@ func _on_start_button_pressed():
elif intMAX > 4095:
$mapSelected.text = "MAX PLAYERS CANNOT BE ABOVE 4095"
else:
print("Player chose player limit: ", intMAX)
Networking.create_server(intPORT, intMAX)
Networking.load_map(SCENE)
Networking.add_player_node(1)
Global.connectedPlayers += [Global.playerName]
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
if $normalRespawn.button_pressed == true:
Global.respawnTimeModifier = 1.0
elif $shortRespawn.button_pressed == true:
Global.respawnTimeModifier = 2
elif $longRespawn.button_pressed == true:
Global.respawnTimeModifier = 0.5
if Global.playerName == "":
$mapSelected.text = "PLAYER NAME CAN'T BE BLANK"
else:
print("Player chose player limit: ", intMAX)
Networking.create_server(intPORT, intMAX)
Networking.load_map(SCENE)
Networking.add_player_node(1)
Global.connectedPlayers += [Global.playerName]
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
if $normalRespawn.button_pressed == true:
Global.respawnTimeModifier = 1.0
elif $shortRespawn.button_pressed == true:
Global.respawnTimeModifier = 2
elif $longRespawn.button_pressed == true:
Global.respawnTimeModifier = 0.5
else:
$mapSelected.text = "NO MAX PLAYERS SELECTED"
else:

View file

@ -37,6 +37,9 @@ func _on_join_button_pressed():
else:
$errorLabel.text = "ERROR: NO PORT SPECIFIED"
return
if Global.playerName == "":
$errorLabel.text = "NAME CAN'T BE BLANK"
return
var result = peer.create_client(IPADD, intPORT)
var resultString = str(result)
$errorLabel.text = resultString