Update Rover rocks to have Geode mesh

This commit is contained in:
akshay 2022-08-21 00:13:06 -04:00
parent 8683916588
commit 50ab2c2579
7 changed files with 12 additions and 15 deletions

View File

@ -40,7 +40,7 @@ start_node = "idle"
script = ExtResource( 1 ) script = ExtResource( 1 )
[node name="ItemSpawn" type="BoneAttachment" parent="Armature/Skeleton" index="1"] [node name="ItemSpawn" type="BoneAttachment" parent="Armature/Skeleton" index="1"]
transform = Transform( 1, 2.77886e-15, 8.74228e-08, 2.76877e-15, 0.996368, -6.33421e-08, -8.74228e-08, 6.3573e-08, 1, 0, 0.00594532, 0 ) transform = Transform( 1, 2.77886e-15, 8.74228e-08, 2.79006e-15, 1.00403, -6.38291e-08, -8.74228e-08, 6.3573e-08, 1, 0, 0.194753, 0 )
bone_name = "Item" bone_name = "Item"
[node name="attached_item" parent="Armature/Skeleton/ItemSpawn" index="0" instance=ExtResource( 3 )] [node name="attached_item" parent="Armature/Skeleton/ItemSpawn" index="0" instance=ExtResource( 3 )]

View File

@ -408,6 +408,7 @@ transform = Transform( 1, 6.98492e-10, -8.19564e-08, -1.45519e-09, 1, 5.78439e-1
transform = Transform( -0.707107, 0, 0.707107, 0, 1, 0, -0.707107, 0, -0.707107, -11, 0, 11 ) transform = Transform( -0.707107, 0, 0.707107, 0, 1, 0, -0.707107, 0, -0.707107, -11, 0, 11 )
[node name="rover_station" parent="Rover_Room" instance=ExtResource( 21 )] [node name="rover_station" parent="Rover_Room" instance=ExtResource( 21 )]
start_broken = true
[node name="CanvasLayer" type="CanvasLayer" parent="."] [node name="CanvasLayer" type="CanvasLayer" parent="."]
pause_mode = 1 pause_mode = 1

View File

@ -1,6 +1,7 @@
[gd_scene load_steps=5 format=2] [gd_scene load_steps=5 format=2]
[ext_resource path="res://scripts/rock.gd" type="Script" id=1] [ext_resource path="res://scripts/rock.gd" type="Script" id=1]
[ext_resource path="res://assets/geode/geode.tscn" type="PackedScene" id=2]
[sub_resource type="PhysicsMaterial" id=9] [sub_resource type="PhysicsMaterial" id=9]
friction = 0.75 friction = 0.75
@ -9,26 +10,21 @@ bounce = 0.5
[sub_resource type="SphereShape" id=7] [sub_resource type="SphereShape" id=7]
radius = 4.0 radius = 4.0
[sub_resource type="SphereMesh" id=8]
radius = 4.0
height = 8.0
[node name="rock" type="RigidBody"] [node name="rock" type="RigidBody"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 4, 0 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 4, 0 )
mass = 5.0 mass = 5.0
physics_material_override = SubResource( 9 ) physics_material_override = SubResource( 9 )
axis_lock_linear_y = true
script = ExtResource( 1 ) script = ExtResource( 1 )
[node name="CollisionShape" type="CollisionShape" parent="."] [node name="CollisionShape" type="CollisionShape" parent="."]
shape = SubResource( 7 ) shape = SubResource( 7 )
[node name="MeshInstance" type="MeshInstance" parent="."]
mesh = SubResource( 8 )
[node name="hit_box" type="Area" parent="."] [node name="hit_box" type="Area" parent="."]
collision_layer = 40 collision_layer = 40
collision_mask = 0 collision_mask = 0
[node name="CollisionShape" type="CollisionShape" parent="hit_box"] [node name="CollisionShape" type="CollisionShape" parent="hit_box"]
shape = SubResource( 7 ) shape = SubResource( 7 )
[node name="geode" parent="." instance=ExtResource( 2 )]
transform = Transform( 10, 0, 0, 0, 10, 0, 0, 0, 10, 0, -3.94248, 0 )

View File

@ -250,7 +250,7 @@ shape = SubResource( 7 )
[node name="LevelArrow" type="MeshInstance" parent="."] [node name="LevelArrow" type="MeshInstance" parent="."]
unique_name_in_owner = true unique_name_in_owner = true
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.689029, 16.3183 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.689029, 17.8414 )
mesh = SubResource( 11 ) mesh = SubResource( 11 )
material/0 = ExtResource( 9 ) material/0 = ExtResource( 9 )

View File

@ -10,6 +10,7 @@ func _init():
func enter_from(state): func enter_from(state):
ctx.coin_machine.enabled = false ctx.coin_machine.enabled = false
ctx.item_dump.enabled = true ctx.item_dump.enabled = true
ctx.item_dump.reset()
ctx.status_text.text = "Offline. Needs Repair" ctx.status_text.text = "Offline. Needs Repair"
ctx.status_light.fail() ctx.status_light.fail()

View File

@ -16,7 +16,6 @@ var items_remaining = []
func _ready(): func _ready():
assert(items_required.size() <= 2) assert(items_required.size() <= 2)
reset()
update_item_balloons() update_item_balloons()
func reset(): func reset():
@ -24,6 +23,7 @@ func reset():
for item in items_required: for item in items_required:
assert(item != null) assert(item != null)
items_remaining.push_back(item) items_remaining.push_back(item)
update_item_balloons()
func on_player_interact(player) -> bool: func on_player_interact(player) -> bool:
if not enabled: if not enabled:

View File

@ -41,10 +41,9 @@ func _on_collection_area_area_entered(area):
func _process(delta): func _process(delta):
$"%progress_bar".value = timer.time_left * 100.0 / timer.wait_time $"%progress_bar".value = timer.time_left * 100.0 / timer.wait_time
var dir_vec : Vector3 = level_arrow.transform.origin - rover.transform.origin var distance = rover.transform.origin.z - level_arrow.transform.origin.z
var distance = dir_vec.length() - arrow_viz_distance var pct = 0.0 if distance <= arrow_viz_distance else ((distance - arrow_viz_distance) / arrow_viz_distance)
var pct = 0.0 if distance < 0 else (distance / arrow_viz_distance) level_arrow.get_active_material(0).set_shader_param("alpha", min(pct, 1.0))
level_arrow.get_active_material(0).set_shader_param("alpha", pct)
func _on_Timer_timeout(): func _on_Timer_timeout():
emit_signal("game_over") emit_signal("game_over")