This commit is contained in:
Paul Black 2023-03-16 22:59:05 -06:00
parent 40fb5a22e8
commit ac6919e31e
30 changed files with 2117 additions and 19 deletions

View file

@ -84,9 +84,13 @@ func _physics_process(delta):
# This variable gets set my the death scene, so we know the player needs to be respawned
if Global.playerPleaseRespawn == true:
get_node(teddyCollider).disabled = false
position.x = 0 #Set player X
position.y = 10 #Set player Y
position.z = 0 #Set player Z
var ramMax = Global.spawnCoords_x.size() - 1
var ramnum = RandomNumberGenerator.new().randi_range(0, ramMax)
print("ramnum: ", ramnum)
print("ramMax: ", ramMax)
position.x = Global.spawnCoords_x[ramnum] #Set player X
position.y = Global.spawnCoords_y[ramnum] #Set player Y
position.z = Global.spawnCoords_z[ramnum] #Set player Z
await get_tree().create_timer(0.5).timeout
Global.reset_variables()
ranRemovePlayer = false

Binary file not shown.

View file

@ -0,0 +1,32 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://bxbhwe1hjul2n"
path="res://.godot/imported/Farmland.glb-37a02e544a74640139277a9d8cf4991a.scn"
[deps]
source_file="res://objects/farmland/Farmland.glb"
dest_files=["res://.godot/imported/Farmland.glb-37a02e544a74640139277a9d8cf4991a.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 MiB

View file

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dc114yqktvs3h"
path.s3tc="res://.godot/imported/Farmland_Grass.png-709c2679c394e38f46347a5551ebab8b.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={}
[deps]
source_file="res://objects/farmland/Farmland_Grass.png"
dest_files=["res://.godot/imported/Farmland_Grass.png-709c2679c394e38f46347a5551ebab8b.s3tc.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: 9.6 MiB

View file

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://vgpu5ge7l6dg"
path.s3tc="res://.godot/imported/Farmland_PavingStones070_2K_Color.png-069aa40f670dc2c435a3d7e7a442ee01.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={}
[deps]
source_file="res://objects/farmland/Farmland_PavingStones070_2K_Color.png"
dest_files=["res://.godot/imported/Farmland_PavingStones070_2K_Color.png-069aa40f670dc2c435a3d7e7a442ee01.s3tc.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: 5.5 MiB

View file

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c6u7b0qa4in58"
path.s3tc="res://.godot/imported/Farmland_Planks.png-e57c9f38aa129a42f5dd0eb87c4d5f32.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={}
[deps]
source_file="res://objects/farmland/Farmland_Planks.png"
dest_files=["res://.godot/imported/Farmland_Planks.png-e57c9f38aa129a42f5dd0eb87c4d5f32.s3tc.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: 5.5 MiB

View file

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://clwc77pxfnakt"
path.s3tc="res://.godot/imported/Farmland_PlanksDark.png-966f8016452b2c9c4294b878865c3cd1.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={}
[deps]
source_file="res://objects/farmland/Farmland_PlanksDark.png"
dest_files=["res://.godot/imported/Farmland_PlanksDark.png-966f8016452b2c9c4294b878865c3cd1.s3tc.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: 5.5 MiB

View file

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cfi71iips71un"
path.s3tc="res://.godot/imported/Farmland_PlanksDark_8.png-f57e71d16a98aa9c0644e54e7d47ad2d.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={}
[deps]
source_file="res://objects/farmland/Farmland_PlanksDark_8.png"
dest_files=["res://.godot/imported/Farmland_PlanksDark_8.png-f57e71d16a98aa9c0644e54e7d47ad2d.s3tc.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.9 MiB

View file

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cp5aynm7fok2t"
path.s3tc="res://.godot/imported/Farmland_Rock.png-c84f6bacff54402d498a282051c6c7a6.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={}
[deps]
source_file="res://objects/farmland/Farmland_Rock.png"
dest_files=["res://.godot/imported/Farmland_Rock.png-c84f6bacff54402d498a282051c6c7a6.s3tc.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.9 MiB

View file

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bvgjhycfi8ixy"
path.s3tc="res://.godot/imported/Farmland_Rock_9.png-29177af88c796ba2dc14d3fb3f158514.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={}
[deps]
source_file="res://objects/farmland/Farmland_Rock_9.png"
dest_files=["res://.godot/imported/Farmland_Rock_9.png-29177af88c796ba2dc14d3fb3f158514.s3tc.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: 5.2 MiB

View file

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ceeqwdkr0qh10"
path.s3tc="res://.godot/imported/Farmland_Shingles.png-fa8f362b619e83f73014e4452cf19fe2.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={}
[deps]
source_file="res://objects/farmland/Farmland_Shingles.png"
dest_files=["res://.godot/imported/Farmland_Shingles.png-fa8f362b619e83f73014e4452cf19fe2.s3tc.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: 5.2 MiB

View file

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c8arp7wkootg1"
path.s3tc="res://.godot/imported/Farmland_Shingles_2.png-e82f151d8e19b2ce869fc630acd319dc.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={}
[deps]
source_file="res://objects/farmland/Farmland_Shingles_2.png"
dest_files=["res://.godot/imported/Farmland_Shingles_2.png-e82f151d8e19b2ce869fc630acd319dc.s3tc.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: 5.5 MiB

View file

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b8nxk38tya654"
path.s3tc="res://.godot/imported/Farmland_water.png-3425e7c3ed361d902ee6cae186c3c2b6.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={}
[deps]
source_file="res://objects/farmland/Farmland_water.png"
dest_files=["res://.godot/imported/Farmland_water.png-3425e7c3ed361d902ee6cae186c3c2b6.s3tc.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

1669
scenes/farmland-map.tscn Normal file

File diff suppressed because one or more lines are too long

View file

@ -32,7 +32,6 @@ offset_top = 577.0
offset_right = 436.0
offset_bottom = 640.0
tooltip_text = "Coming soon"
disabled = true
text = "TUTORIAL"
[node name="playButton" type="Button" parent="."]

View file

@ -1,9 +1,10 @@
[gd_scene load_steps=10 format=3 uid="uid://dkokyp5lwhks4"]
[gd_scene load_steps=9 format=3 uid="uid://dkokyp5lwhks4"]
[ext_resource type="Script" path="res://scripts/maps/tutorial.gd" id="1_40ws8"]
[ext_resource type="PackedScene" uid="uid://dp1q51kvd8uow" path="res://scenes/Teddy.tscn" id="1_081si"]
[ext_resource type="PackedScene" uid="uid://ytbacsuahxie" path="res://scenes/HUD.tscn" id="2_s3v8n"]
[ext_resource type="PackedScene" uid="uid://y3fffh5cdbks" path="res://scenes/AI.tscn" id="4_fttoe"]
[ext_resource type="PackedScene" uid="uid://c1y6p4m0sktfj" path="res://scenes/farmland-map.tscn" id="5_imhi6"]
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_i5hsu"]
sky_top_color = Color(1, 1, 1, 1)
@ -19,11 +20,6 @@ sky = SubResource("Sky_trjyj")
tonemap_mode = 2
glow_enabled = true
[sub_resource type="PlaneMesh" id="PlaneMesh_c6isn"]
[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_hllao"]
data = PackedVector3Array(1, 0, 1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0, -1, 1, 0, -1)
[node name="tutorial" type="Node3D"]
script = ExtResource("1_40ws8")
@ -34,15 +30,6 @@ environment = SubResource("Environment_jlsfy")
transform = Transform3D(-0.866025, -0.433013, 0.25, 0, 0.5, 0.866025, -0.5, 0.75, -0.433013, 0, 0, 0)
shadow_enabled = true
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
transform = Transform3D(12, 0, 0, 0, 12, 0, 0, 0, 12, 0, 0, 0)
mesh = SubResource("PlaneMesh_c6isn")
[node name="StaticBody3D" type="StaticBody3D" parent="MeshInstance3D"]
[node name="CollisionShape3D" type="CollisionShape3D" parent="MeshInstance3D/StaticBody3D"]
shape = SubResource("ConcavePolygonShape3D_hllao")
[node name="Teddy" parent="." instance=ExtResource("1_081si")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.08165e-12, 1.039, 2.08165e-12)
@ -50,3 +37,5 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.08165e-12, 1.039, 2.08165e-
[node name="AI" parent="." instance=ExtResource("4_fttoe")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.27149, 1.04845, -4.64617)
[node name="Farmland" parent="." instance=ExtResource("5_imhi6")]

View file

@ -35,8 +35,16 @@ var chosenRunner # Changed in HUD.gd
var iAmRunner = false # Defines whether you're the runner or not. Used in HUD.gd
var runnerDead = false # When the runner is dead, this goes true
var roundTimer = 300.0 # How long each rounds goes
var mapName # Defined from host.gd, name of map
var spawnCoords_x: Array[float] = [] # Used locally in spawn_locations() function
var spawnCoords_y: Array[float] = [] # Used locally in spawn_locations() function
var spawnCoords_z: Array[float] = [] # Used locally in spawn_locations() function
var spawnCoordsInitalized = false # Used locally
func _process(delta):
#if not spawnCoordsInitalized:
# spawnCoordsInitalized = true
spawn_locations()
if godMode:
pass
elif Input.is_action_pressed("sprint") and not iAmRunner and roundInSession:
@ -66,3 +74,33 @@ func reset_variables():
playerAlive = true
playerPleaseRespawn = false
func spawn_locations():
if mapName == "Toyland":
spawnCoords_x.resize(6)
spawnCoords_y.resize(6)
spawnCoords_z.resize(6)
spawnCoords_x[0] = 9.95
spawnCoords_y[0] = 4.15
spawnCoords_z[0] = -11.88
spawnCoords_x[1] = -12.38
spawnCoords_y[1] = 2.57
spawnCoords_z[1] = -41.53
spawnCoords_x[2] = -12.15
spawnCoords_y[2] = 4.19
spawnCoords_z[2] = -83.06
spawnCoords_x[3] = -50.54
spawnCoords_y[3] = 0.57
spawnCoords_z[3] = -58.60
spawnCoords_x[4] = -28.56
spawnCoords_y[4] = 6.55
spawnCoords_z[4] = -46.37
spawnCoords_x[5] = -43.08
spawnCoords_y[5] = 0.57
spawnCoords_z[5] = -12.74
elif mapName == "Tutorial":
spawnCoords_x.resize(1)
spawnCoords_y.resize(1)
spawnCoords_z.resize(1)
spawnCoords_x[0] = -17.65
spawnCoords_y[0] = 2.85
spawnCoords_z[0] = 11.41

View file

@ -16,6 +16,7 @@ func _on_close_pressed():
func _on_playground_pressed():
$mapSelected.text = "Toyland"
Global.mapName = "Toyland"
SCENE = "res://scenes/toyland.tscn"
$Toyland.visible = true

View file

@ -29,6 +29,7 @@ func _process(delta):
func _on_button_pressed():
if Global.playingGame == false:
get_tree().change_scene_to_file("res://scenes/tutorial.tscn")
Global.mapName = "Tutorial"
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
elif Global.playingGame == true:
self.queue_free()

View file

@ -24,6 +24,7 @@ func create_server(port, maxPlayers):
rpc_id(new_peer_id, "sync_names", Global.connectedPlayers)
rpc_id(new_peer_id, "sync_respawn_speed", Global.respawnTimeModifier)
rpc_id(new_peer_id, "sync_gamemode", Global.gamemode)
rpc_id(new_peer_id, "sync_mapName", Global.mapName)
rpc("add_newly_connected_player_character", new_peer_id)
rpc_id(new_peer_id, "add_previously_connected_player_characters", connected_peers)
add_player_node(new_peer_id)
@ -81,6 +82,10 @@ func sync_respawn_speed(speed):
func sync_gamemode(gamemode):
Global.gamemode = gamemode
@rpc("any_peer", "reliable")
func sync_mapName(map):
Global.mapName = map
@rpc("any_peer", "reliable")
func check_name(name): # Returns true if it finds a matching name
for i in range(Global.connectedPlayers.size()):