summaryrefslogtreecommitdiff
path: root/scenes/levels
diff options
context:
space:
mode:
Diffstat (limited to 'scenes/levels')
-rw-r--r--scenes/levels/base_level.gd16
-rw-r--r--scenes/levels/repeat_this.tscn18
-rw-r--r--scenes/levels/typeracer.gd8
-rw-r--r--scenes/levels/typeracer.tscn8
4 files changed, 22 insertions, 28 deletions
diff --git a/scenes/levels/base_level.gd b/scenes/levels/base_level.gd
index 7add4cc..8261337 100644
--- a/scenes/levels/base_level.gd
+++ b/scenes/levels/base_level.gd
@@ -7,12 +7,18 @@ onready var _path_renderer : PathRenderer = $PathRenderer
onready var _health_bar = $Camera2D/healthbar
onready var _last_camera_location : Vector2 = $Camera2D.position
const _levels = [
- #preload("res://scenes/levels/hearts_introduce.tscn"),
- #preload("res://scenes/levels/typeracer_explain.tscn"),
- #preload("res://scenes/levels/typeracer.tscn"),
- #preload("res://scenes/levels/reactiontest.tscn"),
- #preload("res://scenes/levels/pixel/PixelDefender.tscn"),
+ preload("res://scenes/levels/hearts_introduce.tscn"),
+ preload("res://scenes/levels/typeracer_explain.tscn"),
+ preload("res://scenes/levels/typeracer.tscn"),
+ preload("res://scenes/story/1_bridge.tscn"),
+ preload("res://scenes/story/2_pizza.tscn"),
+ preload("res://scenes/levels/pixel/PixelDefender.tscn"),
+ preload("res://scenes/story/3_go_deeper.tscn"),
+ preload("res://scenes/story/4_prison.tscn"),
preload("res://scenes/levels/puzzle/puzzle.tscn"),
+ preload("res://scenes/story/5_illuminati.tscn"),
+ preload("res://scenes/levels/reactiontest.tscn"),
+ preload("res://scenes/story/6_end.tscn"),
]
var _current_level = 0
diff --git a/scenes/levels/repeat_this.tscn b/scenes/levels/repeat_this.tscn
deleted file mode 100644
index e96cc34..0000000
--- a/scenes/levels/repeat_this.tscn
+++ /dev/null
@@ -1,18 +0,0 @@
-[gd_scene load_steps=3 format=2]
-
-[ext_resource path="res://components/Level.gd" type="Script" id=1]
-[ext_resource path="res://components/textreveal.gd" type="Script" id=2]
-
-[node name="Level" type="Node2D"]
-script = ExtResource( 1 )
-
-[node name="Insturction" type="Label" parent="."]
-margin_left = 373.0
-margin_top = 564.0
-margin_right = 951.0
-margin_bottom = 668.0
-script = ExtResource( 2 )
-__meta__ = {
-"_edit_use_anchors_": false
-}
-to_render = "Repeat the pattern"
diff --git a/scenes/levels/typeracer.gd b/scenes/levels/typeracer.gd
index 35225be..e91e360 100644
--- a/scenes/levels/typeracer.gd
+++ b/scenes/levels/typeracer.gd
@@ -5,6 +5,8 @@ onready var timer_label = $TimeLabel
var timer = 0
var total = 0
+var started = false
+
func start():
.start()
total = _total_time()
@@ -20,13 +22,15 @@ func _total_time():
func _process(delta):
if not running:
return
+ if not started:
+ return
timer += delta
timer_label.text = str(total - timer)
if timer >= total:
eval()
func eval():
- if $Label.text.replace('\r\n', '\n').replace('\r', '\n') == $TextEdit.text.replace('\r\n', '\n').replace('\r', '\n'):
+ if $Label.text.replace('\r\n', '').replace('\r', '').replace(' ', '') == $TextEdit.text.replace('\r\n', '').replace('\r', '').replace(' ', ''):
$TextEdit.readonly = true
$Button.disabled = true
$Incorrect.visible = false
@@ -49,4 +53,6 @@ func _on_Button_on_click():
func _on_TextEdit_text_changed():
+ if not started:
+ started = true
eval_corr()
diff --git a/scenes/levels/typeracer.tscn b/scenes/levels/typeracer.tscn
index 4902263..60a13b0 100644
--- a/scenes/levels/typeracer.tscn
+++ b/scenes/levels/typeracer.tscn
@@ -48,10 +48,10 @@ __meta__ = {
}
[node name="TimeLabel" type="Label" parent="."]
-margin_left = -463.0
-margin_top = -255.0
-margin_right = -291.0
-margin_bottom = -209.0
+margin_left = -397.897
+margin_top = -237.041
+margin_right = -225.897
+margin_bottom = -191.041
__meta__ = {
"_edit_use_anchors_": false
}