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

Add harvested counter

This commit is contained in:
Steffo 2023-01-09 02:17:34 +01:00
parent 95922125c6
commit 06d8416a0d
Signed by: steffo
GPG key ID: 6965406171929D01
3 changed files with 28 additions and 4 deletions

View file

@ -5,6 +5,4 @@ extends RigidBody3D
func _on_collectible_by_player_collected():
# var player: Node3D = Singletons.player
# player.scale *= 1.05
pass
player.collected_fruit += 1

View file

@ -22,8 +22,15 @@ const AIR_ACCELERATE = 100 # Hu/39.97
@onready var active_weapon: BaseWeapon:
get: return OnHand.active_weapon
# DEBUG NODES
@onready var ammo_label = $HUD/AmmoLabel
@onready var fruit_label = $HUD/PineappleLabel
var collected_fruit: int = 0:
get:
return collected_fruit
set(value):
collected_fruit = value
fruit_label.text = "%d harvested" % collected_fruit
var last_frame_input_data: PlayerInputData = PlayerInputData.new()
var input_data: PlayerInputData = PlayerInputData.new()

View file

@ -79,6 +79,7 @@ grow_horizontal = 2
grow_vertical = 2
[node name="CameraViewportContainer" type="SubViewportContainer" parent="Head/Viewport"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
@ -118,6 +119,7 @@ theme = SubResource("Theme_smyke")
[node name="SubViewportContainer" type="SubViewportContainer" parent="HUD"]
show_behind_parent = true
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
@ -146,7 +148,23 @@ position = Vector2(140, 79)
scale = Vector2(1.65, 1)
metadata/_edit_lock_ = true
[node name="PineappleLabel" type="Label" parent="HUD"]
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_left = 8.0
offset_top = -26.0
offset_right = 106.0
offset_bottom = -8.0
grow_vertical = 0
theme = ExtResource("4_d7ru6")
theme_override_font_sizes/font_size = 16
text = "0 harvested"
vertical_alignment = 2
[node name="AmmoLabel" type="Label" parent="HUD"]
layout_mode = 1
anchors_preset = 3
anchor_left = 1.0
anchor_top = 1.0
@ -166,6 +184,7 @@ vertical_alignment = 2
[node name="Crosshair" type="ColorRect" parent="HUD"]
material = SubResource("ShaderMaterial_2p6rt")
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0