From 7c2af0f4f0c500627888961a63d03e392c396f7a Mon Sep 17 00:00:00 2001 From: Luna Date: Tue, 23 Jan 2018 00:39:29 -0500 Subject: [PATCH] Add an endless plane as level 1 --- scenes/levels/1.tscn | 196 +++++++++++++++++++++++++++++++++++++++++++++++++++ scripts/lobby.gd | 2 +- 2 files changed, 197 insertions(+), 1 deletion(-) create mode 100644 scenes/levels/1.tscn diff --git a/scenes/levels/1.tscn b/scenes/levels/1.tscn new file mode 100644 index 0000000..5860957 --- /dev/null +++ b/scenes/levels/1.tscn @@ -0,0 +1,196 @@ +[gd_scene load_steps=8 format=2] + +[ext_resource path="res://scenes/objective.tscn" type="PackedScene" id=1] + +[sub_resource type="SphereShape" id=6] + +radius = 1.0 + +[sub_resource type="SphereMesh" id=7] + +radius = 1.0 +height = 2.0 +radial_segments = 64 +rings = 32 +is_hemisphere = false + +[sub_resource type="DynamicFontData" id=8] + +font_path = "res://assets/DejaVuSansMono.ttf" + +[sub_resource type="DynamicFont" id=9] + +size = 16 +use_mipmaps = false +use_filter = false +font_data = SubResource( 8 ) +_sections_unfolded = [ "Font", "Resource" ] + +[sub_resource type="PlaneShape" id=10] + +plane = Plane( 0, 1, 0, 0 ) + +[sub_resource type="CubeMesh" id=5] + +size = Vector3( 200, 0.4, 200 ) +subdivide_width = 0 +subdivide_height = 0 +subdivide_depth = 0 + +[node name="world" type="Spatial"] + +[node name="DirectionalLight" type="DirectionalLight" parent="." index="0"] + +transform = Transform( 0.784405, 0.193347, -0.589343, 0.315866, 0.693208, 0.647836, 0.533794, -0.694319, 0.482684, -7.6643, 1.97737, 0 ) +layers = 1 +light_color = Color( 1, 1, 1, 1 ) +light_energy = 1.0 +light_indirect_energy = 1.0 +light_negative = false +light_specular = 0.5 +light_bake_mode = 1 +light_cull_mask = -1 +shadow_enabled = false +shadow_color = Color( 0, 0, 0, 1 ) +shadow_bias = 0.1 +shadow_contact = 0.0 +shadow_reverse_cull_face = false +editor_only = false +directional_shadow_mode = 2 +directional_shadow_split_1 = 0.1 +directional_shadow_split_2 = 0.2 +directional_shadow_split_3 = 0.5 +directional_shadow_blend_splits = false +directional_shadow_normal_bias = 0.8 +directional_shadow_bias_split_scale = 0.25 +directional_shadow_depth_range = 0 +directional_shadow_max_distance = 200.0 + +[node name="players" type="Spatial" parent="." index="1"] + +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 11.4634, 0 ) +_sections_unfolded = [ "Transform", "Visibility" ] + +[node name="Ball" type="RigidBody" parent="." index="2"] + +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -14.4344, 6.09969, 4.40885 ) +input_ray_pickable = true +input_capture_on_drag = false +collision_layer = 1 +collision_mask = 1 +mode = 0 +mass = 1.0 +friction = 1.0 +bounce = 0.0 +gravity_scale = 1.0 +custom_integrator = false +continuous_cd = false +contacts_reported = 0 +contact_monitor = false +sleeping = false +can_sleep = true +axis_lock_linear_x = false +axis_lock_linear_y = false +axis_lock_linear_z = false +axis_lock_angular_x = false +axis_lock_angular_y = false +axis_lock_angular_z = false +linear_velocity = Vector3( 0, 0, 0 ) +linear_damp = -1.0 +angular_velocity = Vector3( 0, 0, 0 ) +angular_damp = -1.0 +_sections_unfolded = [ "Collision", "Pause", "Transform", "Visibility" ] + +[node name="CollisionShape" type="CollisionShape" parent="Ball" index="0"] + +shape = SubResource( 6 ) +disabled = false +_sections_unfolded = [ "Transform", "Visibility" ] + +[node name="MeshInstance" type="MeshInstance" parent="Ball" index="1"] + +layers = 1 +material_override = null +cast_shadow = 1 +extra_cull_margin = 0.0 +use_in_baked_light = false +lod_min_distance = 0.0 +lod_min_hysteresis = 0.0 +lod_max_distance = 0.0 +lod_max_hysteresis = 0.0 +mesh = SubResource( 7 ) +skeleton = NodePath("..") +material/0 = null +_sections_unfolded = [ "Geometry", "Transform", "material" ] + +[node name="FullObjective" parent="." index="3" instance=ExtResource( 1 )] + +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -91.3336, 2.0316, 4.06596 ) +_sections_unfolded = [ "Transform" ] + +[node name="Debug" type="Label" parent="." index="4"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 831.0 +margin_top = 27.0 +margin_right = 1004.0 +margin_bottom = 94.0 +grow_horizontal = 0 +rect_pivot_offset = Vector2( 0, 0 ) +mouse_filter = 2 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 4 +custom_fonts/font = SubResource( 9 ) +percent_visible = 1.0 +lines_skipped = 0 +max_lines_visible = -1 +_sections_unfolded = [ "Anchor", "Focus", "Grow Direction", "Hint", "Margin", "Material", "Mouse", "Pause", "Rect", "Size Flags", "Theme", "Visibility", "custom_colors", "custom_constants", "custom_fonts", "custom_styles" ] + +[node name="LeftSpawn" type="Spatial" parent="." index="5"] + +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.96426, 9.36109 ) +_sections_unfolded = [ "Transform" ] + +[node name="RightSpawn" type="Spatial" parent="." index="6"] + +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3.87156, 0 ) + +[node name="StaticBody" type="StaticBody" parent="." index="7"] + +input_ray_pickable = true +input_capture_on_drag = false +collision_layer = 1 +collision_mask = 1 +friction = 1.0 +bounce = 0.0 +constant_linear_velocity = Vector3( 0, 0, 0 ) +constant_angular_velocity = Vector3( 0, 0, 0 ) + +[node name="CollisionShape" type="CollisionShape" parent="StaticBody" index="0"] + +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.2, 0 ) +shape = SubResource( 10 ) +disabled = false +_sections_unfolded = [ "Transform" ] + +[node name="MeshInstance" type="MeshInstance" parent="StaticBody/CollisionShape" index="0"] + +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.2, 0 ) +layers = 1 +material_override = null +cast_shadow = 1 +extra_cull_margin = 0.0 +use_in_baked_light = false +lod_min_distance = 0.0 +lod_min_hysteresis = 0.0 +lod_max_distance = 0.0 +lod_max_hysteresis = 0.0 +mesh = SubResource( 5 ) +skeleton = NodePath("..") +material/0 = null + + diff --git a/scripts/lobby.gd b/scripts/lobby.gd index e9219c1..be664d9 100644 --- a/scripts/lobby.gd +++ b/scripts/lobby.gd @@ -128,7 +128,7 @@ remote func pre_configure_game(): var self_peer_id = get_tree().get_network_unique_id() get_node("/root/Control").queue_free() - var world = load("res://scenes/world.tscn").instance() + var world = load("res://scenes/levels/1.tscn").instance() get_node("/root").add_child(world) # Load all players (including self)