1
Fork 0
mirror of https://github.com/Steffo99/pineapple-surf.git synced 2024-10-16 22:37:30 +00:00

Seeds now increment player's ammo

This commit is contained in:
Steffo 2023-01-08 23:58:26 +01:00
parent b0a716d58e
commit 37c019f776
Signed by: steffo
GPG key ID: 6965406171929D01
2 changed files with 13 additions and 3 deletions

9
island/Seeds.gd Normal file
View file

@ -0,0 +1,9 @@
extends RigidBody3D
@export var value = 5
func _on_collectible_by_player_collected():
var ps: PeaShooter = Singletons.player.get_node("Head/OnHand/PeaShooter")
ps.remaining += value

View file

@ -1,6 +1,7 @@
[gd_scene load_steps=6 format=3 uid="uid://cm0apcnq0f26s"] [gd_scene load_steps=7 format=3 uid="uid://cm0apcnq0f26s"]
[ext_resource type="Texture2D" uid="uid://cdpn34mdaq545" path="res://assets/island_model/texture_1.png" id="1_e06sb"] [ext_resource type="Texture2D" uid="uid://cdpn34mdaq545" path="res://assets/island_model/texture_1.png" id="1_e06sb"]
[ext_resource type="Script" path="res://island/Seeds.gd" id="1_ndq82"]
[ext_resource type="PackedScene" uid="uid://ci0hy0d4d1476" path="res://island/CollectibleByPlayer.tscn" id="5_xl41o"] [ext_resource type="PackedScene" uid="uid://ci0hy0d4d1476" path="res://island/CollectibleByPlayer.tscn" id="5_xl41o"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_meps2"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_meps2"]
@ -35,6 +36,7 @@ mass = 0.01
gravity_scale = 0.0 gravity_scale = 0.0
lock_rotation = true lock_rotation = true
linear_damp = 1.0 linear_damp = 1.0
script = ExtResource("1_ndq82")
[node name="Seeds" type="MeshInstance3D" parent="."] [node name="Seeds" type="MeshInstance3D" parent="."]
mesh = SubResource("ArrayMesh_7vmhj") mesh = SubResource("ArrayMesh_7vmhj")
@ -45,7 +47,6 @@ shape = SubResource("SphereShape3D_geieh")
[node name="CollectibleByPlayer" parent="." instance=ExtResource("5_xl41o")] [node name="CollectibleByPlayer" parent="." instance=ExtResource("5_xl41o")]
target_path = NodePath("..") target_path = NodePath("..")
[node name="CollectSound" parent="CollectibleByPlayer" index="0"] [connection signal="collected" from="CollectibleByPlayer" to="." method="_on_collectible_by_player_collected"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)
[editable path="CollectibleByPlayer"] [editable path="CollectibleByPlayer"]