summaryrefslogtreecommitdiff
path: root/Scenes/Entities/Objects/Coin.gd
blob: 2bbb75cbc43d9f33da7241598d2c196e3321d98d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
extends StaticBody2D


func _ready():
	add_to_group("coins")
	
	var collision_area = Utilities.Collision.Area.new(self, $CollisionShape2D, false)
	collision_area.connect("collided", Callable(self, "_collide"))
	add_child(collision_area)


func _collide(area: Area2D):
	if area.is_in_group("player"):
		queue_free()
	elif area.is_in_group("explosions"):
		queue_free()