basic-move-and-dodge-game

[LEARNING] basic godot game based off the tutorial by borncg on youtube
git clone git://git.figbert.com/basic-move-and-dodge-game.git
Log | Files | Refs | README

Coin.gd (326B)


      1 extends Area
      2 
      3 signal coin_collected
      4 
      5 func _ready():
      6 	pass
      7 
      8 func _physics_process(delta):
      9 	rotate_object_local(Vector3(0,1,0), deg2rad(3))
     10 
     11 func _on_coin_body_entered(body):
     12 	if body.name == "Character":
     13 		$AnimationPlayer.play("bounce")
     14 		$Timer.start()
     15 
     16 func _on_timer_timeout():
     17 	emit_signal("coin_collected")
     18 	queue_free()