started work on door and other various

This commit is contained in:
Clevertop 2024-08-11 21:29:44 +10:00
parent de8bd57c62
commit 419ee45597
6 changed files with 45 additions and 4 deletions

View file

@ -15,13 +15,15 @@ Puzzle game made by Tom for the Playmakers August Jam 2024
- [ ] level funciton - [ ] level funciton
- [x] Losing the game - [x] Losing the game
- [ ] winning the game and moving to next level - [ ] winning the game and moving to next level
- [x] start of level screen
- [x] command functions - [x] command functions
- [ ] test camera controls for framerate independance - [x] test camera controls for framerate independance
- [ ] Menu - [ ] Menu
- [ ] Level select - [ ] Level select
- [ ] Credits page - [ ] Credits page
- [ ] itch.io page - [ ] itch.io page
- [ ] kill blocks - resets level if player touches them - [ ] kill blocks - resets level if player touches them
- [ ] door, starting level button
## COMMANDS ## COMMANDS
@ -34,3 +36,4 @@ Puzzle game made by Tom for the Playmakers August Jam 2024
## BUGS ## BUGS
- [x] cant place command block in pedestals which ahs already had one - [x] cant place command block in pedestals which ahs already had one
- [x] cammoand blocks can be lost by falling out of world - [x] cammoand blocks can be lost by falling out of world
- [ ] movement(+camera?) is framerate dependant

View file

@ -7,6 +7,7 @@ signal tick(time : int)
@export_group("Variables") @export_group("Variables")
@export var level_tick : float = 1 # how often to run a command @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_time : float = 10 # the amoutn of time allowed for the level
@export var level_name : String = "Level X\nTest Room"
#reset these #reset these
var tick_timer : float = 0 var tick_timer : float = 0
@ -35,7 +36,7 @@ func _ready():
pedestals.append(temp) pedestals.append(temp)
for i in pedestals.size(): for i in pedestals.size():
pedestals[i].mesh.mesh = pedestals[i].mesh.mesh.duplicate() 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. # 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) gui.show_lose_screen("", fail_timer)
world_env.environment.background_color = Color.DIM_GRAY world_env.environment.background_color = Color.DIM_GRAY
fail_timer -= delta fail_timer -= delta
if(Input.is_action_just_pressed("reset") and fail_timer < 1.95):
fail_timer = 0
if fail_timer < 0: if fail_timer < 0:
fail_timer = 2 fail_timer = 2
reset_room() reset_room()
@ -127,7 +130,7 @@ func reset_room():
room_started = false room_started = false
current_tick = 0 current_tick = 0
failed = false failed = false
fail_timer = 3 fail_timer = 2
#reset pedestals #reset pedestals
for i in pedestals.size(): for i in pedestals.size():
@ -137,6 +140,10 @@ func reset_room():
# replace door # replace door
# put player back in start room # put player back in start room
# reset timers # reset timers
player.clear_effects()
gui.show_level_title(level_name)
pass pass
func finish_room(): func finish_room():

View file

@ -99,6 +99,7 @@ func _physics_process(delta):
dash_time -= delta dash_time -= delta
var dash_direction = camera.global_position.direction_to(dash_node.global_position) var dash_direction = camera.global_position.direction_to(dash_node.global_position)
dash_direction.y = 0 dash_direction.y = 0
dash_direction = dash_direction.normalized()
velocity = dash_direction * SPEED*350 * delta velocity = dash_direction * SPEED*350 * delta
elif dashing: elif dashing:
dashing = false dashing = false

View file

@ -4,6 +4,10 @@ extends Control
@export var lose_panel : PanelContainer @export var lose_panel : PanelContainer
@export var lose_label : Label @export var lose_label : Label
@export var reset_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. # Called when the node enters the scene tree for the first time.
func _ready(): func _ready():
@ -13,6 +17,8 @@ func _ready():
# Called every frame. 'delta' is the elapsed time since the previous frame. # Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta): func _process(delta):
title_fade -= delta
start_level.modulate.a = clamp(title_fade,0,1)
pass pass
func show_lose_screen(lose_text : String, reset_timer : float): 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(): func hide_lose_screen():
lose_panel.visible = false lose_panel.visible = false
pass pass
func show_level_title(title : String):
level_title.text = title
title_fade = 2

View file

@ -13,7 +13,7 @@ font_size = 60
font_size = 30 font_size = 30
font_color = Color(0.662452, 0.662452, 0.662452, 1) font_color = Color(0.662452, 0.662452, 0.662452, 1)
[node name="Gui" type="Control" node_paths=PackedStringArray("lose_panel", "lose_label", "reset_label")] [node name="Gui" type="Control" node_paths=PackedStringArray("lose_panel", "lose_label", "reset_label", "start_level", "level_title")]
layout_mode = 3 layout_mode = 3
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
@ -24,6 +24,8 @@ script = ExtResource("1_7s0l7")
lose_panel = NodePath("MarginContainer/PanelContainer") lose_panel = NodePath("MarginContainer/PanelContainer")
lose_label = NodePath("MarginContainer/PanelContainer/VBoxContainer/LoseText") lose_label = NodePath("MarginContainer/PanelContainer/VBoxContainer/LoseText")
reset_label = NodePath("MarginContainer/PanelContainer/VBoxContainer/LoseTimer") reset_label = NodePath("MarginContainer/PanelContainer/VBoxContainer/LoseTimer")
start_level = NodePath("MarginContainer/StartPanel")
level_title = NodePath("MarginContainer/StartPanel/VBoxContainer/LevelTitle")
[node name="Label" type="Label" parent="."] [node name="Label" type="Label" parent="."]
visible = false visible = false
@ -60,6 +62,19 @@ theme_override_constants/margin_top = 150
theme_override_constants/margin_right = 200 theme_override_constants/margin_right = 200
theme_override_constants/margin_bottom = 150 theme_override_constants/margin_bottom = 150
[node name="StartPanel" type="PanelContainer" parent="MarginContainer"]
layout_mode = 2
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/StartPanel"]
layout_mode = 2
alignment = 1
[node name="LevelTitle" type="Label" parent="MarginContainer/StartPanel/VBoxContainer"]
layout_mode = 2
text = "Level Failed"
label_settings = SubResource("LabelSettings_v7sqr")
horizontal_alignment = 1
[node name="PanelContainer" type="PanelContainer" parent="MarginContainer"] [node name="PanelContainer" type="PanelContainer" parent="MarginContainer"]
layout_mode = 2 layout_mode = 2

View file

@ -15,6 +15,11 @@ run/main_scene="res://Levels/StartingRoom.tscn"
config/features=PackedStringArray("4.2", "Forward Plus") config/features=PackedStringArray("4.2", "Forward Plus")
config/icon="res://icon.svg" config/icon="res://icon.svg"
[editor]
movie_writer/movie_file="/home/clevertop/Videos/video.avi"
movie_writer/fps=30
[input] [input]
mov_left={ mov_left={