Added modular coin machine and power station. Updated Player code to handle inventory.

This commit is contained in:
akshay committed 2022-08-13 22:07:27 -04:00
1 parent 9956a8f7a4
commit afe0a5d39c
11 files changed
+179 -24

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://scenes/player.tscn" type="PackedScene" id=1]
[ext_resource path="res://scenes/moon.tscn" type="PackedScene" id=2]
[node name="Prototype" type="Spatial"]
[node name="moon" parent="." instance=ExtResource( 2 )]
[node name="Player" parent="." instance=ExtResource( 1 )]
+12
View File
@@ -0,0 +1,12 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://scripts/coin_machine.gd" type="Script" id=1]
[sub_resource type="SphereShape" id=1]
[node name="coin_machine" type="Area"]
script = ExtResource( 1 )
[node name="CollisionShape" type="CollisionShape" parent="."]
transform = Transform( 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0 )
shape = SubResource( 1 )
+15
View File
@@ -0,0 +1,15 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://scenes/player.tscn" type="PackedScene" id=1]
[ext_resource path="res://scenes/moon.tscn" type="PackedScene" id=2]
[ext_resource path="res://scenes/power_station.tscn" type="PackedScene" id=3]
[node name="dev_akshay" type="Spatial"]
[node name="moon" parent="." instance=ExtResource( 2 )]
[node name="power_station" parent="." instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00300264, 1.00556, -4.18269 )
time_to_generate = 5.0
[node name="Player" parent="." instance=ExtResource( 1 )]
+5
View File
@@ -0,0 +1,5 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://moon.glb" type="PackedScene" id=1]
[node name="moon" instance=ExtResource( 1 )]
+34
View File
@@ -0,0 +1,34 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://scripts/Player.gd" type="Script" id=1]
[sub_resource type="CapsuleMesh" id=1]
radius = 0.2
mid_height = 0.85
[sub_resource type="CapsuleShape" id=2]
radius = 0.210213
height = 0.85525
[sub_resource type="SphereShape" id=3]
[node name="Player" type="KinematicBody"]
script = ExtResource( 1 )
[node name="MeshInstance" type="MeshInstance" parent="."]
transform = Transform( 0.994286, 0, 0, 0, -4.34616e-08, -0.994286, 0, 0.994286, -4.34616e-08, 0, 0.666587, 0 )
mesh = SubResource( 1 )
skeleton = NodePath("../..")
[node name="CollisionShape" type="CollisionShape" parent="."]
transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0.641703, 0 )
shape = SubResource( 2 )
[node name="Camera" type="Camera" parent="."]
transform = Transform( 1, 0, 0, 0, 0.5, 0.866025, 0, -0.866025, 0.5, 0, 5.44166, 3.39746 )
fov = 50.0
[node name="TriggerVolume" type="Area" parent="."]
[node name="CollisionShape" type="CollisionShape" parent="TriggerVolume"]
shape = SubResource( 3 )
+20
View File
@@ -0,0 +1,20 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://scripts/power_station.gd" type="Script" id=1]
[ext_resource path="res://scenes/coin_machine.tscn" type="PackedScene" id=2]
[sub_resource type="CubeMesh" id=1]
[node name="power_station" type="Spatial"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0 )
script = ExtResource( 1 )
time_to_generate = 1.0
[node name="coin_machine" parent="." instance=ExtResource( 2 )]
transform = Transform( 4, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0 )
coins_required = 0
[node name="MeshInstance" type="MeshInstance" parent="."]
mesh = SubResource( 1 )
[connection signal="coin_requirement_met" from="coin_machine" to="." method="_on_coin_machine_coin_requirement_met"]