mirror of
https://github.com/Steffo99/pineapple-surf.git
synced 2024-11-21 23:34:21 +00:00
Seeds now increment player's ammo
This commit is contained in:
parent
b0a716d58e
commit
37c019f776
2 changed files with 13 additions and 3 deletions
9
island/Seeds.gd
Normal file
9
island/Seeds.gd
Normal 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
|
|
@ -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"]
|
||||||
|
|
Loading…
Reference in a new issue