before planets

This commit is contained in:
Crizomb 2025-08-03 05:57:42 +02:00
parent bb6404e918
commit e09f05b566
57 changed files with 1203 additions and 90 deletions

View file

@ -1,13 +1,11 @@
extends Node
const LEVELS = [preload("res://scenes/levels/level1.tscn")]
var current_level = 0
@export var nb_checkpoints := 3
@export var max_lap := 3
signal new_lap(value)
signal end_track
var current_checkpoint := 0
var current_lap := 0
@ -18,15 +16,16 @@ func checkPointEnter(check_point_id):
if check_point_id == 0:
current_lap += 1
current_checkpoint += 1
new_lap.emit(current_lap)
else:
current_checkpoint += 1
current_checkpoint %= nb_checkpoints
if (current_lap == max_lap):
if (current_lap == max_lap+1):
endTrack()
return
func endTrack():
print("end")
current_lap = 0
current_checkpoint = 0
end_track.emit()