Browse Source

Color objective to show your team's side

master
Luna 7 years ago
parent
commit
3ecdbe00a6
11 changed files with 118 additions and 56 deletions
  1. +0
    -12
      assets/maze-high-obj.mtl
  2. +0
    -12
      assets/maze.mtl
  3. BIN
      assets/objective-left.png
  4. BIN
      assets/objective-left.xcf
  5. BIN
      assets/objective-right.png
  6. BIN
      assets/objective-right.xcf
  7. BIN
      assets/objective.blend
  8. +49
    -0
      assets/objective.obj
  9. +0
    -12
      assets/player.mtl
  10. +60
    -15
      scenes/objective.tscn
  11. +9
    -5
      scripts/objective.gd

+ 0
- 12
assets/maze-high-obj.mtl View File

@ -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

+ 0
- 12
assets/maze.mtl View File

@ -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

BIN
assets/objective-left.png View File

Before After
Width: 1024  |  Height: 1024  |  Size: 652 KiB

BIN
assets/objective-left.xcf View File


BIN
assets/objective-right.png View File

Before After
Width: 1024  |  Height: 1024  |  Size: 656 KiB

BIN
assets/objective-right.xcf View File


BIN
assets/objective.blend View File


+ 49
- 0
assets/objective.obj View File

@ -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

+ 0
- 12
assets/player.mtl View File

@ -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

+ 60
- 15
scenes/objective.tscn View File

@ -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" ]


+ 9
- 5
scripts/objective.gd View File

@ -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


Loading…
Cancel
Save