1
Fork 0
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:
Steffo 2023-01-09 11:06:02 +01:00
parent 2f96e34f05
commit f12f7f84b6
Signed by: steffo
GPG key ID: 6965406171929D01
2 changed files with 9 additions and 3 deletions

View file

@ -13,7 +13,6 @@ func change_scene(path: String):
func start_game():
print("Starting game...")
Singletons.score = 0
change_scene("res://island/Island.tscn")

View file

@ -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()