added coins

This commit is contained in:
Jonas Braus
2024-07-28 21:20:05 +02:00
parent d13361cdb1
commit 5299f67b81
9 changed files with 239 additions and 3 deletions
+5 -1
View File
@@ -4,6 +4,7 @@ extends CharacterBody2D
@onready var color_rect = $Camera2D/ColorRect
@onready var pipe_timer = $pipe_timer
@onready var pipe_timer_half = $pipe_timer_half
@onready var coin_amt = $CanvasLayer/Control/CoinAmt
const SPEED = 130.0
@@ -14,7 +15,7 @@ var left_pipe = false
var pipe = null
var pipe_target = null
var coins = 0
# Get the gravity from the project settings to be synced with RigidBody nodes.
var gravity = ProjectSettings.get_setting("physics/2d/default_gravity")
var on_pause = false
@@ -75,6 +76,9 @@ func _physics_process(delta):
move_and_slide()
func increase_coins():
coins += 1
coin_amt.text = str(coins)
func _on_pipedetector_area_entered(area):
on_pipe = true