LD56 is over. This is the game.
This commit is contained in:
19
entities/resources/collectable_resource.gd
Normal file
19
entities/resources/collectable_resource.gd
Normal file
@@ -0,0 +1,19 @@
|
||||
class_name CollectableResource extends StaticBody3D
|
||||
|
||||
enum ResourceType {FOOD, STONE, WOOD}
|
||||
@export var type:ResourceType
|
||||
|
||||
var capacity := 100
|
||||
|
||||
func collect(amount:int)->int:
|
||||
if capacity > amount:
|
||||
capacity -= amount
|
||||
return amount
|
||||
else:
|
||||
var remains := capacity
|
||||
capacity = 0
|
||||
return remains
|
||||
|
||||
func _on_tick() -> void:
|
||||
if capacity < 100: return
|
||||
capacity += 1
|
||||
41
entities/resources/food_resource.tscn
Normal file
41
entities/resources/food_resource.tscn
Normal file
@@ -0,0 +1,41 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://dsx7wydm6py7h"]
|
||||
|
||||
[ext_resource type="Script" path="res://entities/resources/collectable_resource.gd" id="1_ys2g0"]
|
||||
[ext_resource type="PackedScene" uid="uid://csjoq8lb6gctu" path="res://assets/fbx/food.fbx" id="2_pn8lj"]
|
||||
[ext_resource type="Script" path="res://entities/overlay_on_hover.gd" id="3_sy2bo"]
|
||||
[ext_resource type="Texture2D" uid="uid://y75pedv63owl" path="res://assets/textures/icons/foodicon.png" id="4_w3ttc"]
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_g8vog"]
|
||||
radius = 2.0
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_llrdr"]
|
||||
albedo_color = Color(0.41, 0.285223, 0.0697, 1)
|
||||
|
||||
[node name="FoodResource" type="StaticBody3D" groups=["NavmeshTargets"]]
|
||||
script = ExtResource("1_ys2g0")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.442429, 0)
|
||||
shape = SubResource("SphereShape3D_g8vog")
|
||||
|
||||
[node name="Timer" type="Timer" parent="."]
|
||||
autostart = true
|
||||
|
||||
[node name="food" parent="." instance=ExtResource("2_pn8lj")]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.00624819, -0.99998, 0, 0.99998, 0.00624819, 0, 0.444963, 0)
|
||||
|
||||
[node name="Food" parent="food" index="0"]
|
||||
surface_material_override/2 = SubResource("StandardMaterial3D_llrdr")
|
||||
script = ExtResource("3_sy2bo")
|
||||
|
||||
[node name="Sprite3D2" type="Sprite3D" parent="."]
|
||||
transform = Transform3D(5, 0, 0, 0, 5, 0, 0, 0, 5, 0, 20, 0)
|
||||
layers = 2
|
||||
billboard = 1
|
||||
texture = ExtResource("4_w3ttc")
|
||||
|
||||
[connection signal="mouse_entered" from="." to="food/Food" method="_on_mouse_entered"]
|
||||
[connection signal="mouse_exited" from="." to="food/Food" method="_on_mouse_exited"]
|
||||
[connection signal="timeout" from="Timer" to="." method="_on_tick"]
|
||||
|
||||
[editable path="food"]
|
||||
32
entities/resources/stone_resource.tscn
Normal file
32
entities/resources/stone_resource.tscn
Normal file
@@ -0,0 +1,32 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://kslywe6neejo"]
|
||||
|
||||
[ext_resource type="Script" path="res://entities/resources/collectable_resource.gd" id="1_ybx4f"]
|
||||
[ext_resource type="PackedScene" uid="uid://rheyik3n6qia" path="res://assets/fbx/rock.fbx" id="2_uwrg3"]
|
||||
[ext_resource type="Texture2D" uid="uid://iftvude25iw" path="res://assets/textures/icons/stoneicon.png" id="3_uq1d7"]
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_2ifhi"]
|
||||
radius = 1.9217
|
||||
|
||||
[node name="StoneResource" type="StaticBody3D" groups=["NavmeshTargets"]]
|
||||
script = ExtResource("1_ybx4f")
|
||||
type = 1
|
||||
|
||||
[node name="Timer" type="Timer" parent="."]
|
||||
autostart = true
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.845515, 0)
|
||||
shape = SubResource("SphereShape3D_2ifhi")
|
||||
|
||||
[node name="rock" parent="." instance=ExtResource("2_uwrg3")]
|
||||
transform = Transform3D(0.97435, -0.225036, 0, 0.225036, 0.97435, 0, 0, 0, 1, 0.497189, 0.726997, -2.5003)
|
||||
|
||||
[node name="Sprite3D2" type="Sprite3D" parent="."]
|
||||
transform = Transform3D(5, 0, 0, 0, 5, 0, 0, 0, 5, 0, 20, 0)
|
||||
layers = 2
|
||||
billboard = 1
|
||||
texture = ExtResource("3_uq1d7")
|
||||
|
||||
[connection signal="timeout" from="Timer" to="." method="_on_tick"]
|
||||
|
||||
[editable path="rock"]
|
||||
39
entities/resources/wood_resource.tscn
Normal file
39
entities/resources/wood_resource.tscn
Normal file
@@ -0,0 +1,39 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://kh5xmgawk26n"]
|
||||
|
||||
[ext_resource type="Script" path="res://entities/resources/collectable_resource.gd" id="1_khlta"]
|
||||
[ext_resource type="PackedScene" uid="uid://87uikru2r8pc" path="res://assets/fbx/plant.fbx" id="2_u6krj"]
|
||||
[ext_resource type="Texture2D" uid="uid://c2uk3aoo6wbpy" path="res://assets/textures/icons/woodicon.png" id="3_i5i26"]
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_32b8q"]
|
||||
radius = 2.49866
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_do68j"]
|
||||
albedo_color = Color(0.53, 0.366053, 0.1908, 1)
|
||||
|
||||
[node name="WoodResource" type="StaticBody3D" groups=["NavmeshTargets"]]
|
||||
script = ExtResource("1_khlta")
|
||||
type = 2
|
||||
|
||||
[node name="Timer" type="Timer" parent="."]
|
||||
autostart = true
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00649216, 0.935511, 0.0162298)
|
||||
shape = SubResource("SphereShape3D_32b8q")
|
||||
|
||||
[node name="plant" parent="." instance=ExtResource("2_u6krj")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.08594, 0)
|
||||
|
||||
[node name="Plant" parent="plant" index="0"]
|
||||
transform = Transform3D(10, 0, 0, 0, -4.37114e-07, 62.94, 0, -10, -2.75119e-06, 0.00649216, 1.08982, 0.0162298)
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_do68j")
|
||||
|
||||
[node name="Sprite3D2" type="Sprite3D" parent="."]
|
||||
transform = Transform3D(5, 0, 0, 0, 5, 0, 0, 0, 5, 0, 20, 0)
|
||||
layers = 2
|
||||
billboard = 1
|
||||
texture = ExtResource("3_i5i26")
|
||||
|
||||
[connection signal="timeout" from="Timer" to="." method="_on_tick"]
|
||||
|
||||
[editable path="plant"]
|
||||
Reference in New Issue
Block a user