Added bounce physics, collision layers, masks, and names, pins (and the extra bouncy GiantPin), walls, cup physics, a sample level, and a score system with an accompanying auto-updating GUI label.
23 lines
370 B
GDScript
23 lines
370 B
GDScript
extends StaticBody2D
|
|
|
|
signal change_score
|
|
|
|
|
|
|
|
|
|
func _ready() -> void:
|
|
var score = get_tree().get_root().find_node("GUI", true, false)
|
|
score.connect("change_score", score, "handle_change_score")
|
|
print(score)
|
|
|
|
|
|
|
|
|
|
func _on_GoalArea_body_entered(body: Node) -> void:
|
|
if body.is_in_group("Balls"):
|
|
print("Yatta!")
|
|
emit_signal("change_score", 10)
|
|
body.queue_free()
|
|
|
|
|