before planets
This commit is contained in:
parent
bb6404e918
commit
e09f05b566
57 changed files with 1203 additions and 90 deletions
|
@ -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()
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
extends Area3D
|
||||
class_name CheckPoint
|
||||
@export var check_point_id : int = 0
|
||||
@onready var check_point_manager: Node = $"../../CheckPointManager"
|
||||
|
||||
|
||||
|
||||
|
@ -8,7 +9,7 @@ func _on_body_entered(body: Node3D) -> void:
|
|||
if body is not Car:
|
||||
return
|
||||
|
||||
CheckPointManager.checkPointEnter(check_point_id)
|
||||
check_point_manager.checkPointEnter(check_point_id)
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -2,4 +2,6 @@
|
|||
|
||||
[resource]
|
||||
transparency = 1
|
||||
blend_mode = 1
|
||||
albedo_color = Color(0.396078, 1, 0.686275, 0.270588)
|
||||
emission = Color(0.396078, 1, 0.686275, 0.270588)
|
||||
|
|
8
entities/checkpoint/checkpoint_start_mat.tres
Normal file
8
entities/checkpoint/checkpoint_start_mat.tres
Normal file
|
@ -0,0 +1,8 @@
|
|||
[gd_resource type="StandardMaterial3D" format=3 uid="uid://cx7p36k3dewle"]
|
||||
|
||||
[resource]
|
||||
transparency = 1
|
||||
blend_mode = 1
|
||||
albedo_color = Color(0.768627, 0.27451, 0.309804, 0.521569)
|
||||
metallic_specular = 1.0
|
||||
emission = Color(0.768627, 0.27451, 0.309804, 0.521569)
|
Loading…
Add table
Add a link
Reference in a new issue