1
Fork 0
mirror of https://github.com/Steffo99/hella-farm.git synced 2024-11-22 08:04:23 +00:00
hella-farm/entities/gold.gd

20 lines
363 B
GDScript3
Raw Normal View History

2024-04-13 17:07:26 +00:00
extends Node2D
class_name Gold
2024-04-13 17:07:26 +00:00
2024-04-14 02:39:45 +00:00
@export var value: int = 1
func _on_move(movement: Vector2) -> void:
position += movement
2024-04-14 02:39:45 +00:00
func _on_collected(tag: StringName) -> void:
2024-04-19 02:30:35 +00:00
var game = MainGame.get_via_group(self)
2024-04-14 02:39:45 +00:00
# TODO: Perhaps use a dictionary in game to store multiple currencies?
match tag:
&"Gold":
game.gold_counter.increase(value)
queue_free()