mirror of
https://github.com/Steffo99/pineapple-surf.git
synced 2024-11-24 08:44:18 +00:00
Cleanup code? Maybe?
This commit is contained in:
parent
2f96e34f05
commit
f12f7f84b6
2 changed files with 9 additions and 3 deletions
|
@ -13,7 +13,6 @@ func change_scene(path: String):
|
|||
|
||||
func start_game():
|
||||
print("Starting game...")
|
||||
Singletons.score = 0
|
||||
change_scene("res://island/Island.tscn")
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
extends Node3D
|
||||
|
||||
|
||||
var score = 0
|
||||
var exploded = false
|
||||
var score: int = 0
|
||||
var time: float = 0.0
|
||||
var exploded: bool = false
|
||||
|
||||
@export var size_per_prayer: float = 0.05
|
||||
@export var pitch_per_prayer: float = 0.02
|
||||
|
@ -47,9 +48,15 @@ func try_to_explode():
|
|||
|
||||
func win():
|
||||
print("YOU WIN!")
|
||||
print("Time: ", time)
|
||||
queue_free()
|
||||
|
||||
|
||||
func _process(delta):
|
||||
if not exploded:
|
||||
time += delta
|
||||
|
||||
|
||||
func _physics_process(_delta):
|
||||
try_to_collect_fruit()
|
||||
try_to_explode()
|
||||
|
|
Loading…
Reference in a new issue