added coins
This commit is contained in:
+5
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user