Checkpoint-System irgendwie komplett verschissen
This commit is contained in:
parent
52da27c158
commit
c2d39d71b2
16 changed files with 154 additions and 35 deletions
49
main.gd
Normal file
49
main.gd
Normal file
|
@ -0,0 +1,49 @@
|
|||
extends Node3D
|
||||
@onready var pause_menu = $PauseMenu
|
||||
|
||||
var paused = false
|
||||
#var showpaused = false
|
||||
var checkpoint = "checkpoint0"
|
||||
var checkpoint0 = Vector3(0, 2, 1.374)
|
||||
var checkpoint1 = Vector3(-27.5, 13, 12.5)
|
||||
var checkpoint2 = Vector3(0, 22, 1.374)
|
||||
var time_accum = 0.0 # Timer accumulator
|
||||
@onready var player = get_node("Player")
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
var player = get_node("Player")
|
||||
# while true:
|
||||
# wait(5)
|
||||
# print(player.checkpoint)
|
||||
|
||||
|
||||
# DEBUG SECTION: Testing whether checkpoint value is accessible by printing it every 4 seconds
|
||||
#func _process(delta: float) -> void:
|
||||
# var player = get_node("Player")
|
||||
# time_accum += delta
|
||||
# if time_accum >= 4.0:
|
||||
# print("Checkpoint:", player.checkpoint)
|
||||
# time_accum = 0.0
|
||||
|
||||
func wait(seconds: float) -> void:
|
||||
await get_tree().create_timer(seconds).timeout
|
||||
|
||||
func _process(delta: float):
|
||||
if Input.is_action_just_pressed("ui_cancel"):
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||
pauseMenu()
|
||||
elif Input.is_action_just_pressed("proluz_ui_respawn"):
|
||||
player.teleport_to_checkpoint
|
||||
|
||||
func pauseMenu():
|
||||
if paused:
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||
pause_menu.hide()
|
||||
Engine.time_scale = 1
|
||||
else:
|
||||
pause_menu.show()
|
||||
Engine.time_scale = 0.00001
|
||||
# Engine.time_scale = -1
|
||||
|
||||
paused = !paused
|
Loading…
Add table
Add a link
Reference in a new issue