parallax background, pickups, slime enemies

This commit is contained in:
OddlyTimbot committed 2026-10-27 21:03:58 -04:00
1 parent c3ab17230b
commit 04f421901c
21 files changed
+710 -7

No files matched your search

+20
View File
@@ -3,6 +3,11 @@ class_name GameController extends Node2D
signal teleportSignal(body:RigidBody2D)
signal destroySignal(body)
var numberOfCrates = 2
var totalCoins = 0
var coinsRemaining = 0
var coinsCollected = 0
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
get_window().grab_focus()
@@ -30,3 +35,18 @@ func _on_bullet_hit(body, bullet) -> void:
destroySignal.emit(body)
destroySignal.emit(bullet)
func crateTotal(amount)->void:
numberOfCrates = amount
if numberOfCrates<=0:
print("YOU WON!!!")
func coinTotal(amount)->void:
if totalCoins == 0:
totalCoins = amount
coinsRemaining = amount
print("Collected "+str(totalCoins-coinsRemaining)+" of "+str(totalCoins) )
func coinCollected(body, coin)->void:
if body is Player:
#give them a coin
coinsCollected +=1
destroySignal.emit(coin)