1
Fork 0
mirror of https://github.com/Steffo99/pineapple-surf.git synced 2024-11-21 15:34:17 +00:00

Create leafpile, containing respawning seeds

This commit is contained in:
Steffo 2023-01-08 22:37:59 +01:00
parent 0c507f4967
commit b3272cff95
Signed by: steffo
GPG key ID: 6965406171929D01
9 changed files with 133 additions and 5 deletions

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,9 @@
newmtl material0
Ka 1.000000 1.000000 1.000000
Kd 1.000000 1.000000 1.000000
Ks 0.000000 0.000000 0.000000
Tr 0.000000
illum 0
Ns 0.000000
map_Kd texture_0.png
map_d texture_0.png

BIN
assets/island_model/leafpile.obj (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,21 @@
[remap]
importer="wavefront_obj"
importer_version=1
type="Mesh"
uid="uid://2aqdmbi5ahj8"
path="res://.godot/imported/leafpile.obj-7f6cadb1e7d73230ee336d877669d594.mesh"
[deps]
files=["res://.godot/imported/leafpile.obj-7f6cadb1e7d73230ee336d877669d594.mesh"]
source_file="res://assets/island_model/leafpile.obj"
dest_files=["res://.godot/imported/leafpile.obj-7f6cadb1e7d73230ee336d877669d594.mesh", "res://.godot/imported/leafpile.obj-7f6cadb1e7d73230ee336d877669d594.mesh"]
[params]
generate_tangents=true
scale_mesh=Vector3(1, 1, 1)
offset_mesh=Vector3(0, 0, 0)
optimize_mesh=true

View file

@ -6,10 +6,10 @@
[ext_resource type="AudioStream" uid="uid://lkftwgdun745" path="res://assets/pop.wav" id="3_gur2a"]
[ext_resource type="Script" path="res://island/Pop.gd" id="4_5e7wk"]
[sub_resource type="BoxShape3D" id="BoxShape3D_uv07x"]
[sub_resource type="BoxShape3D" id="BoxShape3D_flxvl"]
size = Vector3(1, 0.1, 1)
[sub_resource type="ArrayMesh" id="ArrayMesh_fdp43"]
[sub_resource type="ArrayMesh" id="ArrayMesh_b2165"]
_surfaces = [{
"aabb": AABB(-0.5, 0, -0.5, 1.00001, 1.00001, 1),
"attribute_data": PackedByteArray(143, 194, 117, 63, 183, 109, 91, 63, 31, 133, 107, 63, 219, 182, 109, 63, 31, 133, 107, 63, 183, 109, 91, 63, 143, 194, 117, 63, 219, 182, 109, 63, 143, 194, 117, 63, 183, 109, 91, 63, 31, 133, 107, 63, 183, 109, 91, 63, 31, 133, 107, 63, 219, 182, 109, 63, 143, 194, 117, 63, 219, 182, 109, 63, 143, 194, 117, 63, 183, 109, 91, 63, 31, 133, 107, 63, 183, 109, 91, 63, 31, 133, 107, 63, 219, 182, 109, 63, 143, 194, 117, 63, 219, 182, 109, 63, 143, 194, 117, 63, 183, 109, 91, 63, 31, 133, 107, 63, 183, 109, 91, 63, 31, 133, 107, 63, 219, 182, 109, 63, 143, 194, 117, 63, 219, 182, 109, 63),
@ -37,11 +37,11 @@ collision_mask = 0
[node name="PlantableArea" type="CollisionShape3D" parent="Plant"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.05, 0)
shape = SubResource("BoxShape3D_uv07x")
shape = SubResource("BoxShape3D_flxvl")
[node name="Sprout" type="MeshInstance3D" parent="Plant"]
transform = Transform3D(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
mesh = SubResource("ArrayMesh_fdp43")
mesh = SubResource("ArrayMesh_b2165")
skeleton = NodePath("../../..")
[node name="GrowthTimer" type="Timer" parent="."]

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=15 format=3 uid="uid://bg88gc1w1gw5m"]
[gd_scene load_steps=16 format=3 uid="uid://bg88gc1w1gw5m"]
[ext_resource type="PackedScene" uid="uid://dh5blytk6vmdu" path="res://island/Sea.tscn" id="1_e0hpm"]
[ext_resource type="PackedScene" uid="uid://b5i1sqd88wlle" path="res://player/Player.tscn" id="3_5378m"]
@ -8,6 +8,7 @@
[ext_resource type="PackedScene" uid="uid://bknwefv5ycc3u" path="res://island/PyramidSmolMesh.tscn" id="6_klmt8"]
[ext_resource type="PackedScene" uid="uid://boxtb3trgcy8c" path="res://island/PillarMesh.tscn" id="7_grmwj"]
[ext_resource type="PackedScene" uid="uid://cwf11kdk7t64k" path="res://island/HoppityMesh.tscn" id="8_5pio0"]
[ext_resource type="PackedScene" uid="uid://dutcugv574855" path="res://island/Leafpile.tscn" id="9_472aa"]
[ext_resource type="PackedScene" uid="uid://cm0apcnq0f26s" path="res://island/Seeds.tscn" id="10_l32rj"]
[sub_resource type="Gradient" id="Gradient_shcpx"]
@ -82,6 +83,9 @@ transform = Transform3D(-1, 3.48787e-16, -8.74228e-08, 3.48787e-16, 1, -3.48787e
[node name="CropTiles" type="Node3D" parent="."]
[node name="Leafpile" parent="CropTiles" instance=ExtResource("9_472aa")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 3, 3)
[node name="Produce" type="Node3D" parent="."]
[node name="Seeds" parent="Produce" instance=ExtResource("10_l32rj")]

37
island/Leafpile.tscn Normal file
View file

@ -0,0 +1,37 @@
[gd_scene load_steps=6 format=3 uid="uid://dutcugv574855"]
[ext_resource type="Texture2D" uid="uid://ebyf8q6s6yuj" path="res://assets/island_model/texture_0.png" id="1_qnv14"]
[ext_resource type="PackedScene" uid="uid://ceki0n8cyjlrm" path="res://island/RespawnPad.tscn" id="2_04d83"]
[ext_resource type="PackedScene" uid="uid://cm0apcnq0f26s" path="res://island/Seeds.tscn" id="3_r4rxd"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ijmro"]
resource_name = "material0"
transparency = 1
albedo_texture = ExtResource("1_qnv14")
metallic = 1.0
texture_filter = 0
texture_repeat = false
[sub_resource type="ArrayMesh" id="ArrayMesh_o7j0n"]
_surfaces = [{
"aabb": AABB(-5.55112e-17, 0.0625, 0, 1.00001, 9.99868e-06, 1),
"attribute_data": PackedByteArray(143, 194, 245, 62, 110, 219, 54, 63, 174, 71, 225, 62, 146, 36, 73, 63, 174, 71, 225, 62, 110, 219, 54, 63, 143, 194, 245, 62, 146, 36, 73, 63),
"format": 4119,
"index_count": 6,
"index_data": PackedByteArray(0, 0, 1, 0, 2, 0, 3, 0, 1, 0, 0, 0),
"material": SubResource("StandardMaterial3D_ijmro"),
"name": "material0",
"primitive": 3,
"vertex_count": 4,
"vertex_data": PackedByteArray(0, 0, 128, 63, 0, 0, 128, 61, 0, 0, 0, 0, 255, 127, 255, 255, 255, 255, 255, 191, 0, 0, 128, 164, 0, 0, 128, 61, 0, 0, 128, 63, 255, 127, 255, 255, 255, 255, 255, 191, 0, 0, 128, 164, 0, 0, 128, 61, 0, 0, 0, 0, 255, 127, 255, 255, 255, 255, 255, 191, 0, 0, 128, 63, 0, 0, 128, 61, 0, 0, 128, 63, 255, 127, 255, 255, 255, 255, 255, 191)
}]
[node name="Leafpile" type="MeshInstance3D"]
mesh = SubResource("ArrayMesh_o7j0n")
skeleton = NodePath("../..")
[node name="RespawnPad" parent="." instance=ExtResource("2_04d83")]
spawn_on_ready = true
spawn_scene = ExtResource("3_r4rxd")
[editable path="RespawnPad"]

41
island/RespawnPad.gd Normal file
View file

@ -0,0 +1,41 @@
extends Node3D
@export var spawn_on_ready: bool
@export var spawn_scene: PackedScene
@onready var respawn_timer: Timer = $RespawnTimer
@onready var produce_container: Node3D = get_tree().root.find_child("Produce", true, false)
var current_node: Node = null
signal spawned(node)
signal collected()
func spawn():
if current_node == null:
var node = spawn_scene.instantiate()
node.position = global_position
current_node = node
produce_container.add_child(node)
node.connect("tree_exiting", _on_collect)
emit_signal("spawned", node)
func _on_collect():
current_node = null
respawn_timer.start()
emit_signal("collected")
func _on_respawn_timeout():
spawn()
func _ready():
if spawn_on_ready:
spawn()
else:
respawn_timer.start()

12
island/RespawnPad.tscn Normal file
View file

@ -0,0 +1,12 @@
[gd_scene load_steps=2 format=3 uid="uid://ceki0n8cyjlrm"]
[ext_resource type="Script" path="res://island/RespawnPad.gd" id="1_u4xy3"]
[node name="RespawnPad" type="Node3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5, 0.5, 0.5)
script = ExtResource("1_u4xy3")
[node name="RespawnTimer" type="Timer" parent="."]
wait_time = 15.0
[connection signal="timeout" from="RespawnTimer" to="." method="_on_respawn_timeout"]