godot/demos/2d/platformer/coin.gd
Rémi Verschelde 7589b2bf60 Improve code formatting
The scripts were streamlined using more or less the following conventions:
 - space after a comma in lists of arguments
 - spaces around weak operators (+, -), no spaces around strong operators (*, /)
 - spaces around comparison operators and compound assignment operators
 - space after a comment start (#)
 - removed trailing spaces or tabs, apart from those that delimit the function indentation level (those could be removed too but since they are added automatically by the editor when typing code, keeping them for now)
 - function blocks separate by two newlines
 - comment sentences start with an upper-case letter
2015-12-09 08:39:12 +01:00

20 lines
371 B
GDScript

extends Area2D
# Member variables
var taken = false
func _on_body_enter( body ):
if (not taken and body extends preload("res://player.gd")):
get_node("anim").play("taken")
taken = true
func _on_coin_area_enter(area):
pass # replace with function body
func _on_coin_area_enter_shape(area_id, area, area_shape, area_shape):
pass # replace with function body