coins~
This commit is contained in:
parent
792dd99546
commit
37a19d8788
14 changed files with 379 additions and 105 deletions
19
Prefabs/coin.gd
Normal file
19
Prefabs/coin.gd
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
extends Area2D
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
modulate = Storyteller.current_coin_color
|
||||
|
||||
|
||||
func _on_body_entered(body: Node2D) -> void:
|
||||
if body is RigidBody2D:
|
||||
#body.apply_force((body.global_position - global_position).normalized() *10000)
|
||||
#body.linear_velocity = (body.global_position - global_position).normalized() *100
|
||||
queue_free()
|
||||
body.got_points.emit()
|
||||
Loading…
Add table
Add a link
Reference in a new issue