started work on door and other various
This commit is contained in:
parent
de8bd57c62
commit
419ee45597
6 changed files with 45 additions and 4 deletions
|
|
@ -7,6 +7,7 @@ signal tick(time : int)
|
|||
@export_group("Variables")
|
||||
@export var level_tick : float = 1 # how often to run a command
|
||||
@export var level_time : float = 10 # the amoutn of time allowed for the level
|
||||
@export var level_name : String = "Level X\nTest Room"
|
||||
|
||||
#reset these
|
||||
var tick_timer : float = 0
|
||||
|
|
@ -35,7 +36,7 @@ func _ready():
|
|||
pedestals.append(temp)
|
||||
for i in pedestals.size():
|
||||
pedestals[i].mesh.mesh = pedestals[i].mesh.mesh.duplicate()
|
||||
pass # Replace with function body.
|
||||
gui.show_level_title(level_name)
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
|
|
@ -80,6 +81,8 @@ func _process(delta):
|
|||
gui.show_lose_screen("", fail_timer)
|
||||
world_env.environment.background_color = Color.DIM_GRAY
|
||||
fail_timer -= delta
|
||||
if(Input.is_action_just_pressed("reset") and fail_timer < 1.95):
|
||||
fail_timer = 0
|
||||
if fail_timer < 0:
|
||||
fail_timer = 2
|
||||
reset_room()
|
||||
|
|
@ -127,7 +130,7 @@ func reset_room():
|
|||
room_started = false
|
||||
current_tick = 0
|
||||
failed = false
|
||||
fail_timer = 3
|
||||
fail_timer = 2
|
||||
|
||||
#reset pedestals
|
||||
for i in pedestals.size():
|
||||
|
|
@ -137,6 +140,10 @@ func reset_room():
|
|||
# replace door
|
||||
# put player back in start room
|
||||
# reset timers
|
||||
|
||||
player.clear_effects()
|
||||
gui.show_level_title(level_name)
|
||||
|
||||
pass
|
||||
|
||||
func finish_room():
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ func _physics_process(delta):
|
|||
dash_time -= delta
|
||||
var dash_direction = camera.global_position.direction_to(dash_node.global_position)
|
||||
dash_direction.y = 0
|
||||
dash_direction = dash_direction.normalized()
|
||||
velocity = dash_direction * SPEED*350 * delta
|
||||
elif dashing:
|
||||
dashing = false
|
||||
|
|
|
|||
|
|
@ -4,6 +4,10 @@ extends Control
|
|||
@export var lose_panel : PanelContainer
|
||||
@export var lose_label : Label
|
||||
@export var reset_label : Label
|
||||
@export var start_level : PanelContainer
|
||||
@export var level_title : Label
|
||||
|
||||
var title_fade : float = 2.5
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
|
|
@ -13,6 +17,8 @@ func _ready():
|
|||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
title_fade -= delta
|
||||
start_level.modulate.a = clamp(title_fade,0,1)
|
||||
pass
|
||||
|
||||
func show_lose_screen(lose_text : String, reset_timer : float):
|
||||
|
|
@ -24,3 +30,7 @@ func show_lose_screen(lose_text : String, reset_timer : float):
|
|||
func hide_lose_screen():
|
||||
lose_panel.visible = false
|
||||
pass
|
||||
|
||||
func show_level_title(title : String):
|
||||
level_title.text = title
|
||||
title_fade = 2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue