diff --git a/assets/maze-high-obj.mtl b/assets/maze-high-obj.mtl deleted file mode 100644 index 102f280..0000000 --- a/assets/maze-high-obj.mtl +++ /dev/null @@ -1,12 +0,0 @@ -# Blender MTL File: 'maze-high-obj.blend' -# Material Count: 1 - -newmtl Material -Ns 96.078431 -Ka 1.000000 1.000000 1.000000 -Kd 0.640000 0.640000 0.640000 -Ks 0.500000 0.500000 0.500000 -Ke 0.000000 0.000000 0.000000 -Ni 1.000000 -d 1.000000 -illum 2 diff --git a/assets/maze.mtl b/assets/maze.mtl deleted file mode 100644 index ae2aeb6..0000000 --- a/assets/maze.mtl +++ /dev/null @@ -1,12 +0,0 @@ -# Blender MTL File: 'maze.blend' -# Material Count: 1 - -newmtl Material -Ns 96.078431 -Ka 1.000000 1.000000 1.000000 -Kd 0.640000 0.640000 0.640000 -Ks 0.500000 0.500000 0.500000 -Ke 0.000000 0.000000 0.000000 -Ni 1.000000 -d 1.000000 -illum 2 diff --git a/assets/objective-left.png b/assets/objective-left.png new file mode 100644 index 0000000..4e9dfcd Binary files /dev/null and b/assets/objective-left.png differ diff --git a/assets/objective-left.xcf b/assets/objective-left.xcf new file mode 100644 index 0000000..eb99d33 Binary files /dev/null and b/assets/objective-left.xcf differ diff --git a/assets/objective-right.png b/assets/objective-right.png new file mode 100644 index 0000000..caab4f7 Binary files /dev/null and b/assets/objective-right.png differ diff --git a/assets/objective-right.xcf b/assets/objective-right.xcf new file mode 100644 index 0000000..dd5a729 Binary files /dev/null and b/assets/objective-right.xcf differ diff --git a/assets/objective.blend b/assets/objective.blend new file mode 100644 index 0000000..69be035 Binary files /dev/null and b/assets/objective.blend differ diff --git a/assets/objective.obj b/assets/objective.obj new file mode 100644 index 0000000..9b315a2 --- /dev/null +++ b/assets/objective.obj @@ -0,0 +1,49 @@ +# Blender v2.79 (sub 0) OBJ File: 'objective.blend' +# www.blender.org +mtllib objective.mtl +o Cube_Cube.001 +v -7.000000 -0.250000 7.000000 +v -7.000000 0.250000 7.000000 +v -7.000000 -0.250000 -7.000000 +v -7.000000 0.250000 -7.000000 +v 7.000000 -0.250000 7.000000 +v 7.000000 0.250000 7.000000 +v 7.000000 -0.250000 -7.000000 +v 7.000000 0.250000 -7.000000 +vt 1.000000 0.500000 +vt 0.968750 0.500000 +vt 0.968750 0.000000 +vt 1.000000 0.000000 +vt 0.968750 0.500000 +vt 0.937500 0.500000 +vt 0.937500 0.000000 +vt 0.968750 0.000000 +vt 0.906250 0.500000 +vt 0.875000 0.500000 +vt 0.874999 0.000000 +vt 0.906249 0.000000 +vt 0.937500 0.000000 +vt 0.937500 0.500000 +vt 0.906250 0.500000 +vt 0.000000 1.000000 +vt 0.000000 0.500000 +vt 0.874999 0.500000 +vt 0.874999 1.000000 +vt 0.874999 0.000000 +vt 0.874999 0.500000 +vt 0.000000 0.500000 +vt 0.000000 0.000000 +vn -1.0000 0.0000 0.0000 +vn 0.0000 0.0000 -1.0000 +vn 1.0000 0.0000 0.0000 +vn 0.0000 0.0000 1.0000 +vn 0.0000 -1.0000 0.0000 +vn 0.0000 1.0000 0.0000 +usemtl None +s off +f 1/1/1 2/2/1 4/3/1 3/4/1 +f 3/5/2 4/6/2 8/7/2 7/8/2 +f 7/9/3 8/10/3 6/11/3 5/12/3 +f 5/12/4 6/13/4 2/14/4 1/15/4 +f 3/16/5 7/17/5 5/18/5 1/19/5 +f 8/20/6 4/21/6 2/22/6 6/23/6 diff --git a/assets/player.mtl b/assets/player.mtl deleted file mode 100644 index 792a42e..0000000 --- a/assets/player.mtl +++ /dev/null @@ -1,12 +0,0 @@ -# Blender MTL File: 'player.blend' -# Material Count: 1 - -newmtl Material -Ns 96.078431 -Ka 1.000000 1.000000 1.000000 -Kd 0.640000 0.640000 0.640000 -Ks 0.500000 0.500000 0.500000 -Ke 0.000000 0.000000 0.000000 -Ni 1.000000 -d 1.000000 -illum 2 diff --git a/scenes/objective.tscn b/scenes/objective.tscn index 1a76faf..5a69d65 100644 --- a/scenes/objective.tscn +++ b/scenes/objective.tscn @@ -1,19 +1,65 @@ -[gd_scene load_steps=5 format=2] +[gd_scene load_steps=6 format=2] [ext_resource path="res://scripts/objective.gd" type="Script" id=1] +[ext_resource path="res://assets/objective.obj" type="ArrayMesh" id=2] [sub_resource type="BoxShape" id=1] extents = Vector3( 7, 0.25, 7 ) -[sub_resource type="CubeMesh" id=2] - -size = Vector3( 14, 0.5, 14 ) -subdivide_width = 0 -subdivide_height = 0 -subdivide_depth = 0 - -[sub_resource type="CapsuleShape" id=3] +[sub_resource type="SpatialMaterial" id=5] + +render_priority = 0 +flags_transparent = false +flags_unshaded = false +flags_vertex_lighting = false +flags_no_depth_test = false +flags_use_point_size = false +flags_world_triplanar = false +flags_fixed_size = false +flags_albedo_tex_force_srgb = false +vertex_color_use_as_albedo = false +vertex_color_is_srgb = false +params_diffuse_mode = 0 +params_specular_mode = 0 +params_blend_mode = 0 +params_cull_mode = 0 +params_depth_draw_mode = 0 +params_line_width = 1.0 +params_point_size = 1.0 +params_billboard_mode = 0 +params_grow = false +params_use_alpha_scissor = false +albedo_color = Color( 1, 1, 1, 1 ) +metallic = 0.0 +metallic_specular = 0.5 +metallic_texture_channel = 0 +roughness = 0.0 +roughness_texture_channel = 0 +emission_enabled = false +normal_enabled = false +rim_enabled = false +clearcoat_enabled = false +anisotropy_enabled = false +ao_enabled = false +depth_enabled = false +subsurf_scatter_enabled = false +transmission_enabled = false +refraction_enabled = false +detail_enabled = false +uv1_scale = Vector3( 1, 1, 1 ) +uv1_offset = Vector3( 0, 0, 0 ) +uv1_triplanar = false +uv1_triplanar_sharpness = 1.0 +uv2_scale = Vector3( 1, 1, 1 ) +uv2_offset = Vector3( 0, 0, 0 ) +uv2_triplanar = false +uv2_triplanar_sharpness = 1.0 +proximity_fade_enable = false +distance_fade_enable = false +_sections_unfolded = [ "Albedo" ] + +[sub_resource type="CapsuleShape" id=4] radius = 0.5 height = 14.0 @@ -56,9 +102,8 @@ shape = SubResource( 1 ) disabled = false _sections_unfolded = [ "Transform" ] -[node name="MeshInstance5" type="MeshInstance" parent="Objective/CollisionShape" index="0"] +[node name="MeshInstance" type="MeshInstance" parent="Objective" index="1"] -transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.274852 ) layers = 1 material_override = null cast_shadow = 1 @@ -68,10 +113,10 @@ lod_min_distance = 0.0 lod_min_hysteresis = 0.0 lod_max_distance = 0.0 lod_max_hysteresis = 0.0 -mesh = SubResource( 2 ) +mesh = ExtResource( 2 ) skeleton = NodePath("..") -material/0 = null -_sections_unfolded = [ "Transform" ] +material/0 = SubResource( 5 ) +_sections_unfolded = [ "Transform", "material" ] [node name="HingeJoint" type="HingeJoint" parent="." index="1"] @@ -107,7 +152,7 @@ _sections_unfolded = [ "Collision", "Transform" ] [node name="CollisionShape" type="CollisionShape" parent="Rod" index="0"] -shape = SubResource( 3 ) +shape = SubResource( 4 ) disabled = false _sections_unfolded = [ "Transform", "Visibility" ] diff --git a/scripts/objective.gd b/scripts/objective.gd index ec1b5f8..94111b9 100644 --- a/scripts/objective.gd +++ b/scripts/objective.gd @@ -6,7 +6,7 @@ var active = false var right_active = false var activation_margin = 0.1 -var update_frequency = 2 # In secs. This isn't too fast-paced, so don't clog the network with updates every frame +var update_frequency = 1 # In secs. This isn't too fast-paced, so don't clog the network with updates every frame var update_count = 0 var master_team_right = null @@ -20,10 +20,10 @@ func _integrate_forces(state): if active: activation_margin = 0 - if rot < -activation_margin: + if rot > activation_margin: active = true right_active = false - if rot > activation_margin: + if rot < -activation_margin: active = true right_active = true if active: @@ -45,6 +45,9 @@ func _process(delta): master_team_right = master_player.player_info.is_right_team friend_color = master_player.friend_color enemy_color = master_player.enemy_color + var name = "right" if master_team_right else "left" + var full_name = "res://assets/objective-%s.png" % name + get_node("MeshInstance").get_surface_material(0).albedo_texture = load(full_name) # Count the percents if active: @@ -55,8 +58,9 @@ func _process(delta): update_count += delta if is_network_master() and update_count > update_frequency: update_count = 0 - rset_unreliable("left", left) - rset_unreliable("right", right) + print("updatey counts") + rset("left", left) + rset("right", right) # Check for game over var game_over = false