Files
godot-demo-projects/2d/physics_platformer/coin/coin.gd
A Thousand Ships 0343cedd48 General proofreading (#1262)
* General proofreading for grammar and spelling
* General formatting
* Addition of appropriate literals where appropriate, i.e. `&"foo"` for `StringName` cases and `^"foo/bar"` for `NodePath` cases
2025-10-11 01:39:59 -07:00

9 lines
184 B
GDScript

class_name Coin
extends Area2D
var taken := false
func _on_body_enter(body: Node2D) -> void:
if not taken and body is Player:
($AnimationPlayer as AnimationPlayer).play(&"taken")