Skip to content

Commit

Permalink
Shovel poo (#50)
Browse files Browse the repository at this point in the history
* added manure and shovel interactions

* Shovel Crashing

* Squashed commit of the following:

commit 6068e8a
Author: Xkonti <[email protected]>
Date:   Tue Aug 20 00:12:13 2024 -0400

    Competition UI + S tier player only podium (#46)

    * Add grading to the results screen

    * Make kale heal more

    * Bring try again button to front

    * Fix words spacing

    * Update results ui

    * Show only the player when S category

commit ac32707
Author: Xkonti <[email protected]>
Date:   Mon Aug 19 23:01:37 2024 -0400

    Import assets, pretty up the world with proc-gen, small fixes (#45)

    * Hide ray by default

    * Import houses, city, new sprites

    * Use new icon for fertilizer

    * Dress up world map

    * Ground houses

    * Import barn

    * Import tree asset and make spawner

    * Add trees and barns to the world

    * Fix trees, growth ray

commit c71376e
Author: D4Devil <[email protected]>
Date:   Mon Aug 19 20:58:36 2024 -0600

    Fertilizer (#44)

    * Added support for physiscs based particles, added sshakable component, fertilizer and fertilizer particle.
    Refactored droplet.gd to a more generic nutrient_particle.gd

    * missing files added

    * Particles were colinding on invisible plane

    * added nutrient aplication

    * Added audio to nutrients

* Shovel working more reliable

* Amend plant stats
  • Loading branch information
D4Devil authored Aug 20, 2024
1 parent dd09f49 commit 97301c8
Show file tree
Hide file tree
Showing 17 changed files with 384 additions and 47 deletions.
Binary file added assets/models/shovel/Shovel.glb
Binary file not shown.
36 changes: 36 additions & 0 deletions assets/models/shovel/Shovel.glb.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[remap]

importer="scene"
importer_version=1
type="PackedScene"
uid="uid://bvkin2vsv8sue"
path="res://.godot/imported/Shovel.glb-84e5cc6791c823369aa385136ebd464a.scn"

[deps]

source_file="res://assets/models/shovel/Shovel.glb"
dest_files=["res://.godot/imported/Shovel.glb-84e5cc6791c823369aa385136ebd464a.scn"]

[params]

nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
_subresources={}
gltf/naming_version=1
gltf/embedded_image_handling=1
Binary file added assets/models/shovel/Shovel_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions assets/models/shovel/Shovel_0.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://b6bhf0x0vc6el"
path.s3tc="res://.godot/imported/Shovel_0.png-4e28bc3b8d46cd399b4196f6adadb10b.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={
"md5": "365638085e2ee236bcf5f9f7431cd092"
}

[deps]

source_file="res://assets/models/shovel/Shovel_0.png"
dest_files=["res://.godot/imported/Shovel_0.png-4e28bc3b8d46cd399b4196f6adadb10b.s3tc.ctex"]

[params]

compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0
2 changes: 2 additions & 0 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ import/blender/enabled=false

Kale="A simple way to check for kale"
Particle="subscribe to avoid particles destroying each other"
Manure=""
Near_Manure=""

[input]

Expand Down
4 changes: 2 additions & 2 deletions scenes/characters/plant.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,11 @@ libraries = {
}
autoplay = "start"

[node name="StaticBody3D" type="StaticBody3D" parent="." groups=["Kale"]]
[node name="PlantStaticBody" type="StaticBody3D" parent="." groups=["Kale"]]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.0110452, 0)
collision_layer = 5
input_ray_pickable = false

[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D"]
[node name="CollisionShape3D" type="CollisionShape3D" parent="PlantStaticBody"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.227664, 0)
shape = SubResource("CylinderShape3D_h4exj")
72 changes: 33 additions & 39 deletions scenes/levels/sandbox.tscn
Original file line number Diff line number Diff line change
@@ -1,67 +1,61 @@
[gd_scene load_steps=9 format=3 uid="uid://cw5exb5acr2g8"]
[gd_scene load_steps=8 format=3 uid="uid://vw37xvmq31p2"]

[ext_resource type="PackedScene" uid="uid://wolhcr7alfel" path="res://scenes/objects/pipette.tscn" id="1_sx1id"]
[ext_resource type="PackedScene" uid="uid://cnrasbhxgwc1j" path="res://scenes/objects/watering_can.tscn" id="2_8i4hr"]
[ext_resource type="PackedScene" uid="uid://4sjcjhj5roj3" path="res://scenes/objects/fertilizer.tscn" id="3_538kw"]
[ext_resource type="PackedScene" uid="uid://dtq401eqrs2xm" path="res://scenes/objects/shovel.tscn" id="1_bkrsc"]
[ext_resource type="PackedScene" path="res://scenes/manure.tscn" id="1_jtr7i"]

[sub_resource type="GDScript" id="GDScript_d65r6"]
script/source = "extends Node3D


func _on_ready():
GameStateMachine.on_new_game_started()
"

[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_pw76e"]
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_j8a0q"]
sky_horizon_color = Color(0.64625, 0.65575, 0.67075, 1)
ground_horizon_color = Color(0.64625, 0.65575, 0.67075, 1)

[sub_resource type="Sky" id="Sky_knro2"]
sky_material = SubResource("ProceduralSkyMaterial_pw76e")
[sub_resource type="Sky" id="Sky_7l111"]
sky_material = SubResource("ProceduralSkyMaterial_j8a0q")

[sub_resource type="Environment" id="Environment_kajjd"]
[sub_resource type="Environment" id="Environment_jh8xe"]
background_mode = 2
sky = SubResource("Sky_knro2")
sky = SubResource("Sky_7l111")
tonemap_mode = 2
glow_enabled = true

[sub_resource type="WorldBoundaryShape3D" id="WorldBoundaryShape3D_u4y0c"]
[sub_resource type="WorldBoundaryShape3D" id="WorldBoundaryShape3D_iwqth"]

[sub_resource type="PlaneMesh" id="PlaneMesh_ipmml"]
size = Vector2(100, 100)

[node name="Sandbox" type="Node3D"]
script = SubResource("GDScript_d65r6")

[node name="PipetteV2" parent="." instance=ExtResource("1_sx1id")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.61293, 0.290948, -1.1817)
[node name="Manure" parent="." instance=ExtResource("1_jtr7i")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.70761, 0, 0.383677)

[node name="WateringCan" parent="." instance=ExtResource("2_8i4hr")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.50447, 0.101947, -1.01724)
[node name="Shovel" parent="." instance=ExtResource("1_bkrsc")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.586574, 0)

[node name="World" type="Node" parent="."]

[node name="WorldEnvironment" type="WorldEnvironment" parent="World"]
environment = SubResource("Environment_kajjd")

[node name="DirectionalLight3D" type="DirectionalLight3D" parent="World"]
transform = Transform3D(0.377534, 0.801936, -0.462998, -9.83849e-09, 0.5, 0.866026, 0.925996, -0.326954, 0.188767, -0.748584, 0, 0)
transform = Transform3D(-0.866023, -0.433016, 0.250001, 0, 0.499998, 0.866027, -0.500003, 0.749999, -0.43301, 0, 0, 0)
light_color = Color(0.82462, 0.797398, 0, 1)
shadow_enabled = true

[node name="WorldEnvironment" type="WorldEnvironment" parent="World"]
environment = SubResource("Environment_jh8xe")

[node name="Camera3D" type="Camera3D" parent="World"]
transform = Transform3D(0.999048, 0.00437078, -0.0434065, 0, 0.994969, 0.100187, 0.043626, -0.100092, 0.994021, -0.100661, 0.397145, 1.10567)
transform = Transform3D(0.741415, -0.359544, 0.566597, 0, 0.844348, 0.535796, -0.671047, -0.397247, 0.626012, 3.08501, 2.9173, 3.40851)

[node name="Floor" type="StaticBody3D" parent="World"]
collision_layer = 9
collision_layer = 4105
input_ray_pickable = false

[node name="CollisionShape3D" type="CollisionShape3D" parent="World/Floor"]
shape = SubResource("WorldBoundaryShape3D_u4y0c")
shape = SubResource("WorldBoundaryShape3D_iwqth")

[node name="Wall" type="StaticBody3D" parent="World"]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, -1.50239)
collision_layer = 16
input_ray_pickable = false
[node name="MeshInstance3D" type="MeshInstance3D" parent="World/Floor"]
mesh = SubResource("PlaneMesh_ipmml")

[node name="CollisionShape3D" type="CollisionShape3D" parent="World/Wall"]
shape = SubResource("WorldBoundaryShape3D_u4y0c")
[node name="ShovelPlane" type="StaticBody3D" parent="World"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.87561, 0)
collision_layer = 4096
input_ray_pickable = false

[node name="Fertilizer" parent="." instance=ExtResource("3_538kw")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0987327, -1.19209e-07, -1.2276)
shake_axis = Vector3(0.2, 0, 0)
[node name="CollisionShape3D" type="CollisionShape3D" parent="World/ShovelPlane"]
shape = SubResource("WorldBoundaryShape3D_iwqth")
19 changes: 18 additions & 1 deletion scenes/levels/world.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=36 format=3 uid="uid://bg7g48sbn5na8"]
[gd_scene load_steps=39 format=3 uid="uid://bg7g48sbn5na8"]

[ext_resource type="PackedScene" uid="uid://fgpto6xwiehx" path="res://scenes/characters/plant.tscn" id="1_hy1fl"]
[ext_resource type="PackedScene" uid="uid://ethfqolg7tpy" path="res://assets/models/world/world_sphere.glb" id="1_w6odn"]
Expand All @@ -25,6 +25,8 @@
[ext_resource type="PackedScene" uid="uid://touox4x6ip7l" path="res://assets/models/city/city.glb" id="17_rp11v"]
[ext_resource type="PackedScene" path="res://scenes/props/tree.tscn" id="22_dqnln"]
[ext_resource type="PackedScene" uid="uid://dqxhamrsiplmr" path="res://assets/models/barrel/Empty Barrel.glb" id="25_rrnhn"]
[ext_resource type="PackedScene" uid="uid://dtq401eqrs2xm" path="res://scenes/objects/shovel.tscn" id="26_y47rk"]
[ext_resource type="PackedScene" path="res://scenes/manure.tscn" id="27_4j008"]
[ext_resource type="PackedScene" uid="uid://btnpd8nq3wmio" path="res://scenes/objects/sprinkler.tscn" id="26_scyh7"]

[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_ngwyh"]
Expand Down Expand Up @@ -67,6 +69,8 @@ plane = Plane(0, 0, 1, 0)

[sub_resource type="WorldBoundaryShape3D" id="WorldBoundaryShape3D_m3dr5"]

[sub_resource type="WorldBoundaryShape3D" id="WorldBoundaryShape3D_uwc1y"]

[node name="World" type="Node3D"]

[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
Expand Down Expand Up @@ -435,6 +439,14 @@ collision_mask = 0
[node name="CollisionShape3D" type="CollisionShape3D" parent="ObjectPlanes/KillZone"]
shape = SubResource("WorldBoundaryShape3D_m3dr5")

[node name="ShovelPlane" type="StaticBody3D" parent="ObjectPlanes"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.12729, 0)
collision_layer = 4096
input_ray_pickable = false

[node name="CollisionShape3D" type="CollisionShape3D" parent="ObjectPlanes/ShovelPlane"]
shape = SubResource("WorldBoundaryShape3D_uwc1y")

[node name="Interactable" type="Node" parent="."]

[node name="Pipette" parent="Interactable" instance=ExtResource("9_r1hjq")]
Expand Down Expand Up @@ -475,6 +487,11 @@ pixel_size = 0.08
[node name="BarrelEmpty" parent="Interactable" instance=ExtResource("25_rrnhn")]
transform = Transform3D(6.47824, -0.00842768, 6.70653, -6.11579e-10, 9.32444, 0.0117174, -6.70654, -0.00814079, 6.47823, -90.0538, -0.735255, -61.1986)

[node name="Shovel_RigidBody" parent="Interactable" instance=ExtResource("26_y47rk")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.43683, 0.447091, -5.41675)

[node name="Manure" parent="Interactable" instance=ExtResource("27_4j008")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.53843, 0, -10.0521)
[node name="Sprinkler" parent="Interactable" instance=ExtResource("26_scyh7")]
transform = Transform3D(-0.840784, 0, -0.541371, 0, 1, 0, 0.541371, 0, -0.840784, 2.68783, 0, 3.91572)
nutrient_volume = 0.002
Expand Down
2 changes: 1 addition & 1 deletion scenes/main.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[ext_resource type="Script" path="res://scripts/main.gd" id="1_y3gh7"]
[ext_resource type="PackedScene" uid="uid://r32fqmgx0nvx" path="res://scenes/levels/results_1.tscn" id="3_rdji2"]
[ext_resource type="PackedScene" uid="uid://bg7g48sbn5na8" path="res://scenes/levels/world.tscn" id="3_wuwph"]
[ext_resource type="PackedScene" uid="uid://c1kn418mqcv0r" path="res://scenes/audio_manager.tscn" id="4_8a2ct"]
[ext_resource type="PackedScene" path="res://scenes/audio_manager.tscn" id="4_8a2ct"]
[ext_resource type="PackedScene" uid="uid://3jbkb6afp78t" path="res://scenes/ui/ui.tscn" id="4_c2oqb"]

[node name="Main" type="Node3D"]
Expand Down
71 changes: 71 additions & 0 deletions scenes/manure.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
[gd_scene load_steps=7 format=3 uid="uid://bn6ahprue2v3c"]

[ext_resource type="Script" path="res://scripts/objects/components/manure_area.gd" id="1_6wdg1"]

[sub_resource type="SphereShape3D" id="SphereShape3D_d0p24"]

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_0k20i"]
albedo_color = Color(0.46119, 0.235364, 0.013829, 1)

[sub_resource type="SphereMesh" id="SphereMesh_futkm"]
material = SubResource("StandardMaterial3D_0k20i")
radius = 0.4
height = 0.3
is_hemisphere = true

[sub_resource type="CylinderShape3D" id="CylinderShape3D_uftl3"]
height = 3.07776
radius = 2.49839

[sub_resource type="CylinderShape3D" id="CylinderShape3D_2iwbx"]
height = 3.26599
radius = 1.35291

[node name="Manure" type="StaticBody3D"]
collision_layer = 0

[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.12604, 0)
shape = SubResource("SphereShape3D_d0p24")

[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
transform = Transform3D(1.68, 0, 0, 0, 1.68, 0, 0, 0, 1.68, 0.195244, 0.162443, -0.314451)
mesh = SubResource("SphereMesh_futkm")

[node name="MeshInstance3D2" type="MeshInstance3D" parent="."]
transform = Transform3D(1.68, 0, 0, 0, 1.68, 0, 0, 0, 1.68, 0.465393, 0.00993574, 0.249388)
mesh = SubResource("SphereMesh_futkm")

[node name="MeshInstance3D3" type="MeshInstance3D" parent="."]
transform = Transform3D(1.68, 0, 0, 0, 1.68, 0, 0, 0, 1.68, -0.610732, 0, 0)
mesh = SubResource("SphereMesh_futkm")

[node name="MeshInstance3D4" type="MeshInstance3D" parent="."]
transform = Transform3D(1.68, 0, 0, 0, 1.68, 0, 0, 0, 1.68, 0, 0, 0.622342)
mesh = SubResource("SphereMesh_futkm")

[node name="Area3D2" type="Area3D" parent="." groups=["Near_Manure"]]
collision_layer = 0
input_ray_pickable = false
script = ExtResource("1_6wdg1")

[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.893792, 0)
shape = SubResource("CylinderShape3D_uftl3")

[node name="Area3D" type="Area3D" parent="." groups=["Manure"]]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.476593, 0)
collision_layer = 0
input_ray_pickable = false
script = ExtResource("1_6wdg1")

[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.52857, 0)
shape = SubResource("CylinderShape3D_2iwbx")

[connection signal="body_entered" from="Area3D2" to="Area3D" method="on_body_entered"]
[connection signal="body_entered" from="Area3D2" to="Area3D2" method="on_body_entered"]
[connection signal="body_exited" from="Area3D2" to="Area3D" method="on_body_exited"]
[connection signal="body_exited" from="Area3D2" to="Area3D2" method="on_body_exited"]
[connection signal="body_entered" from="Area3D" to="Area3D" method="on_body_entered"]
[connection signal="body_exited" from="Area3D" to="Area3D" method="on_body_exited"]
37 changes: 37 additions & 0 deletions scenes/objects/poo_scoop.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[gd_scene load_steps=7 format=3 uid="uid://bhohjtuoosxm6"]

[ext_resource type="Script" path="res://scripts/objects/components/nutrient_particle.gd" id="1_ts4vc"]
[ext_resource type="Script" path="res://scripts/resources/nutrient.gd" id="2_fg5i6"]

[sub_resource type="Resource" id="Resource_dcl5d"]
script = ExtResource("2_fg5i6")
nutrient_type = 2
volume = 50.0

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_w3ybe"]
albedo_color = Color(0.481625, 0.245126, 0.0955891, 1)

[sub_resource type="BoxMesh" id="BoxMesh_codte"]
material = SubResource("StandardMaterial3D_w3ybe")
size = Vector3(0.3, 0.3, 0.3)

[sub_resource type="BoxShape3D" id="BoxShape3D_yhlcp"]
size = Vector3(0.292725, 0.288879, 0.292725)

[node name="PooScoop" type="RigidBody3D"]
collision_layer = 256
input_ray_pickable = false
freeze_mode = 1
script = ExtResource("1_ts4vc")
nutrient = SubResource("Resource_dcl5d")

[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.15, 0)
mesh = SubResource("BoxMesh_codte")
skeleton = NodePath("")

[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.15, 0)
shape = SubResource("BoxShape3D_yhlcp")

[connection signal="body_entered" from="." to="." method="_on_body_entered"]
Loading

0 comments on commit 97301c8

Please sign in to comment.