1
Fork 0
mirror of https://github.com/Steffo99/hella-farm.git synced 2024-11-24 17:14:23 +00:00

Make Gold feel more satisfying to collect

This commit is contained in:
Steffo 2024-04-24 04:35:35 +02:00
parent e54831e616
commit 93c3e734f1
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0
2 changed files with 9 additions and 2 deletions

View file

@ -2,6 +2,9 @@ extends Node2D
class_name Gold
@export var speed_up_factor := 8.0
@onready var game: MainGame = MainGame.get_via_group(self)
@onready var move_towards: MoveTowards = %"MoveTowards"
@onready var collect_sound_spawner: Spawner = %"CollectSoundSpawner"
@ -22,3 +25,7 @@ func collect() -> void:
func _on_move(movement: Vector2) -> void:
position += movement
func _physics_process(delta: float) -> void:
if move_towards.target != null:
move_towards.speed *= pow(speed_up_factor, delta)

View file

@ -9,12 +9,13 @@
[ext_resource type="PackedScene" uid="uid://eqg6snsgn1kh" path="res://players/gold_pickup_player.tscn" id="6_eoeje"]
[sub_resource type="CircleShape2D" id="CircleShape2D_w1h35"]
radius = 64.0
radius = 96.0
[sub_resource type="CircleShape2D" id="CircleShape2D_jm7yp"]
[node name="Gold" type="Node2D"]
script = ExtResource("1_lbls1")
speed_up_factor = 8.0
[node name="Collectible" parent="." instance=ExtResource("2_j75yq")]
unique_name_in_owner = true
@ -38,7 +39,6 @@ debug_color = Color(0, 0.388235, 0.815686, 0.219608)
[node name="MoveTowards" parent="." instance=ExtResource("5_bcbgf")]
unique_name_in_owner = true
speed = 184.0
[node name="CollectSoundSpawner" parent="." instance=ExtResource("5_t7ey8")]
unique_name_in_owner = true