a game about throwing hammers made for the github game off
regenerate uuids + doc more + strip pointless player anims
bendn 2022-11-24
parent 98da2a7 · commit b803959
-rw-r--r--Main.gd7
-rw-r--r--Main.tscn68
-rw-r--r--assets/hammers/hammer01.pngbin127 -> 126 bytes
-rw-r--r--assets/hammers/hammer02.pngbin131 -> 131 bytes
-rw-r--r--assets/hammers/hammer03.pngbin122 -> 127 bytes
-rw-r--r--assets/player/animations.pngbin3469 -> 905 bytes
-rw-r--r--autoloads/Globals.gd3
-rw-r--r--autoloads/Utils.gd11
-rw-r--r--classes/Maze.gd7
-rw-r--r--colliders/hitbox.tscn2
-rw-r--r--colliders/hittable.gd3
-rw-r--r--colliders/hurtbox.gd3
-rw-r--r--colliders/hurtbox.tscn2
-rw-r--r--enemys/Enemy.gd4
-rw-r--r--enemys/Enemy.tscn9
-rw-r--r--enemys/wrencher.gd4
-rw-r--r--enemys/wrencher.tscn10
-rw-r--r--enemys/wrencher_collision.tres2
-rw-r--r--fx/double_jump.tscn16
-rw-r--r--fx/dust.tscn16
-rw-r--r--fx/enemy_death.tscn2
-rw-r--r--fx/fx.tscn2
-rw-r--r--fx/jump.tscn16
-rw-r--r--fx/trail.gd6
-rw-r--r--fx/wall_dust.tscn16
-rw-r--r--hammers/8x14.tres2
-rw-r--r--hammers/hammer.gd9
-rw-r--r--hammers/hammer_01.tscn4
-rw-r--r--hammers/hammer_02.tscn7
-rw-r--r--hammers/hammer_03.tscn18
-rw-r--r--hammers/hammer_base.tscn25
-rw-r--r--hammers/hammer_outline.gdshader36
-rw-r--r--hammers/trail_color.tres2
-rw-r--r--hammers/trail_width.tres2
-rw-r--r--levels/Level.gd20
-rw-r--r--levels/Level.tscn4
-rw-r--r--levels/LevelManager.gd78
-rw-r--r--levels/Start.gd9
-rw-r--r--levels/Start.tscn4
-rw-r--r--levels/rand/01.tscn12
-rw-r--r--levels/rand/02.tscn9
-rw-r--r--levels/rand/03.tscn8
-rw-r--r--levels/rand/04.tscn9
-rw-r--r--levels/rand/05.tscn9
-rw-r--r--levels/rand/06.tscn4
-rw-r--r--levels/rand/07.tscn4
-rw-r--r--levels/rand/08.tscn4
-rw-r--r--levels/rand/09.tscn4
-rw-r--r--levels/rand/10.tscn4
-rw-r--r--levels/rand/11.tscn4
-rw-r--r--levels/rand/12.tscn4
-rw-r--r--levels/rand/13.tscn4
-rw-r--r--levels/rand/14.tscn4
-rw-r--r--levels/rand/15.tscn4
-rw-r--r--levels/rand/16.tscn4
-rw-r--r--levels/rand/17.tscn4
-rw-r--r--levels/rand/18.tscn4
-rw-r--r--player/player.gd308
-rw-r--r--player/player.tscn13
-rw-r--r--player/player_collision.tres4
-rw-r--r--project.godot10
-rw-r--r--world/camera.tscn2
-rw-r--r--world/door/block_door.tscn6
-rw-r--r--world/door/block_door_path.tres2
-rw-r--r--world/door/door.gd3
-rw-r--r--world/door/door.tscn4
-rw-r--r--world/door/door_shape.tres2
-rw-r--r--world/one_way_platform.tscn6
-rw-r--r--world/tiles.tres2
69 files changed, 518 insertions, 372 deletions
diff --git a/Main.gd b/Main.gd
index 802459b..cd2d0ac 100644
--- a/Main.gd
+++ b/Main.gd
@@ -1,7 +1,4 @@
extends Node2D
-var maze: Maze
-
-
-func _on_level_manager_world_generated(p_maze: Maze) -> void:
- maze = p_maze
+func _init() -> void:
+ RenderingServer.set_default_clear_color(Color.BLACK)
diff --git a/Main.tscn b/Main.tscn
index 12e0b08..04faf8a 100644
--- a/Main.tscn
+++ b/Main.tscn
@@ -1,30 +1,27 @@
-[gd_scene load_steps=25 format=3 uid="uid://b4g41v2qctg7f"]
+[gd_scene load_steps=23 format=3 uid="uid://dcaws2iac7w3y"]
[ext_resource type="Script" path="res://Main.gd" id="1_l4fqe"]
-[ext_resource type="PackedScene" uid="uid://c1fgxkkh72npw" path="res://player/player.tscn" id="1_ug1uc"]
-[ext_resource type="PackedScene" uid="uid://c8hhhk21dtpe0" path="res://levels/Start.tscn" id="2_vg2cv"]
+[ext_resource type="PackedScene" uid="uid://umj2kojm6mlo" path="res://player/player.tscn" id="1_ug1uc"]
+[ext_resource type="PackedScene" uid="uid://dqxnsdq67j23x" path="res://levels/Start.tscn" id="2_vg2cv"]
[ext_resource type="Script" path="res://levels/LevelManager.gd" id="3_yuvn4"]
-[ext_resource type="PackedScene" uid="uid://txq8h42d4oqi" path="res://levels/rand/01.tscn" id="4_e4ceh"]
-[ext_resource type="PackedScene" uid="uid://gev80rx2b8vn" path="res://levels/rand/02.tscn" id="5_vqiwr"]
-[ext_resource type="PackedScene" uid="uid://esupr5vkktt" path="res://levels/rand/03.tscn" id="6_v5xvb"]
-[ext_resource type="PackedScene" uid="uid://wgp3b5vk3qbs" path="res://levels/rand/04.tscn" id="7_rihcm"]
-[ext_resource type="PackedScene" uid="uid://lb0i4wxlcdo3" path="res://levels/rand/05.tscn" id="8_5a36k"]
-[ext_resource type="PackedScene" uid="uid://cmex8m63vfpoj" path="res://levels/rand/06.tscn" id="9_3vmkv"]
-[ext_resource type="PackedScene" uid="uid://bh0o48w2ir4l2" path="res://levels/rand/07.tscn" id="10_7n0bw"]
-[ext_resource type="PackedScene" uid="uid://x3fddi5udbur" path="res://levels/rand/08.tscn" id="11_skonw"]
-[ext_resource type="PackedScene" uid="uid://b7w7ns27n53rh" path="res://levels/rand/09.tscn" id="12_5n213"]
-[ext_resource type="PackedScene" uid="uid://gyxkjwsih0s2" path="res://levels/rand/10.tscn" id="13_ni5ug"]
-[ext_resource type="PackedScene" uid="uid://bkywu3kc1xfep" path="res://levels/rand/11.tscn" id="14_uubx2"]
-[ext_resource type="PackedScene" uid="uid://dnn448k214c42" path="res://levels/rand/12.tscn" id="15_x5iyq"]
-[ext_resource type="PackedScene" uid="uid://dkci2hmtjgrvj" path="res://levels/rand/13.tscn" id="16_xq64q"]
-[ext_resource type="PackedScene" uid="uid://bxokgsjhvo0ad" path="res://levels/rand/14.tscn" id="17_c4kk1"]
-[ext_resource type="PackedScene" uid="uid://cnwifdbe2eqv8" path="res://levels/rand/15.tscn" id="18_mpe1f"]
-[ext_resource type="PackedScene" uid="uid://d4dwvcp6764bx" path="res://levels/rand/16.tscn" id="19_ko67h"]
-[ext_resource type="PackedScene" uid="uid://duo0cbnh5u3qt" path="res://levels/rand/17.tscn" id="20_f85eu"]
-[ext_resource type="PackedScene" uid="uid://cy3kc27btbipt" path="res://levels/rand/18.tscn" id="21_rvdjm"]
-[ext_resource type="PackedScene" uid="uid://f7wqdmugs712" path="res://enemys/wrencher.tscn" id="23_p2dy5"]
-
-[sub_resource type="RectangleShape2D" id="RectangleShape2D_htk2i"]
+[ext_resource type="PackedScene" uid="uid://bujj6au21fw2" path="res://levels/rand/01.tscn" id="4_e4ceh"]
+[ext_resource type="PackedScene" uid="uid://yl0khissgys3" path="res://levels/rand/02.tscn" id="5_vqiwr"]
+[ext_resource type="PackedScene" uid="uid://cc2cke0h0rq2" path="res://levels/rand/03.tscn" id="6_v5xvb"]
+[ext_resource type="PackedScene" uid="uid://byccymelwvur8" path="res://levels/rand/04.tscn" id="7_rihcm"]
+[ext_resource type="PackedScene" uid="uid://hr0ueup48w71" path="res://levels/rand/05.tscn" id="8_5a36k"]
+[ext_resource type="PackedScene" uid="uid://887jva236kjn" path="res://levels/rand/06.tscn" id="9_3vmkv"]
+[ext_resource type="PackedScene" uid="uid://dsjel2dj0wjo2" path="res://levels/rand/07.tscn" id="10_7n0bw"]
+[ext_resource type="PackedScene" uid="uid://s1lsinwfques" path="res://levels/rand/08.tscn" id="11_skonw"]
+[ext_resource type="PackedScene" uid="uid://e4kinwyx5821" path="res://levels/rand/09.tscn" id="12_5n213"]
+[ext_resource type="PackedScene" uid="uid://dd74d1a4uirhr" path="res://levels/rand/10.tscn" id="13_ni5ug"]
+[ext_resource type="PackedScene" uid="uid://dip1l1cd8s8p0" path="res://levels/rand/11.tscn" id="14_uubx2"]
+[ext_resource type="PackedScene" uid="uid://bfpc41oqcf0qw" path="res://levels/rand/12.tscn" id="15_x5iyq"]
+[ext_resource type="PackedScene" uid="uid://ml0vpr107gc8" path="res://levels/rand/13.tscn" id="16_xq64q"]
+[ext_resource type="PackedScene" uid="uid://cpg5dac48jhj0" path="res://levels/rand/14.tscn" id="17_c4kk1"]
+[ext_resource type="PackedScene" uid="uid://bk6x0rwnfcnax" path="res://levels/rand/15.tscn" id="18_mpe1f"]
+[ext_resource type="PackedScene" uid="uid://dcbnac3k5c2bh" path="res://levels/rand/16.tscn" id="19_ko67h"]
+[ext_resource type="PackedScene" uid="uid://pk206siyyege" path="res://levels/rand/17.tscn" id="20_f85eu"]
+[ext_resource type="PackedScene" uid="uid://dbcrx23xsfrlp" path="res://levels/rand/18.tscn" id="21_rvdjm"]
[node name="Main" type="Node2D"]
texture_filter = 1
@@ -39,30 +36,13 @@ layer_0/tile_data = PackedInt32Array(131072, 0, 1, 196608, 0, 1, 262144, 262144,
[node name="LevelManager" type="Node" parent="." node_paths=PackedStringArray("current_level", "player")]
unique_name_in_owner = true
script = ExtResource("3_yuvn4")
-levels = [ExtResource("4_e4ceh"), ExtResource("5_vqiwr"), ExtResource("6_v5xvb"), ExtResource("7_rihcm"), ExtResource("8_5a36k"), ExtResource("9_3vmkv"), ExtResource("10_7n0bw"), ExtResource("11_skonw"), ExtResource("12_5n213"), ExtResource("13_ni5ug"), ExtResource("14_uubx2"), ExtResource("15_x5iyq"), ExtResource("16_xq64q"), ExtResource("17_c4kk1"), ExtResource("18_mpe1f"), ExtResource("19_ko67h"), ExtResource("20_f85eu"), ExtResource("21_rvdjm")]
current_level = NodePath("../Start")
+start = ExtResource("2_vg2cv")
player = NodePath("../player")
+levels = [ExtResource("4_e4ceh"), ExtResource("5_vqiwr"), ExtResource("6_v5xvb"), ExtResource("7_rihcm"), ExtResource("8_5a36k"), ExtResource("9_3vmkv"), ExtResource("10_7n0bw"), ExtResource("11_skonw"), ExtResource("12_5n213"), ExtResource("13_ni5ug"), ExtResource("14_uubx2"), ExtResource("15_x5iyq"), ExtResource("16_xq64q"), ExtResource("17_c4kk1"), ExtResource("18_mpe1f"), ExtResource("19_ko67h"), ExtResource("20_f85eu"), ExtResource("21_rvdjm")]
[node name="Camera" type="Camera2D" parent="."]
offset = Vector2(128, 128)
current = true
zoom = Vector2(1.25, 1.25)
-
-[node name="RigidBody2D" type="RigidBody2D" parent="."]
-position = Vector2(164, 82)
-collision_layer = 8
-collision_mask = 11
-mass = 5.0
-
-[node name="CollisionShape2D" type="CollisionShape2D" parent="RigidBody2D"]
-shape = SubResource("RectangleShape2D_htk2i")
-
-[node name="Polygon2D" type="Polygon2D" parent="RigidBody2D"]
-polygon = PackedVector2Array(-10, -10, -10, -10, 10, -10, 10, 10, -10, 10)
-
-[node name="Wrencher" parent="." instance=ExtResource("23_p2dy5")]
-position = Vector2(16, 163)
-rotation = 1.57079
-
-[connection signal="world_generated" from="LevelManager" to="." method="_on_level_manager_world_generated"]
-[connection signal="died" from="Wrencher" to="Wrencher" method="die"]
+position_smoothing_enabled = true
diff --git a/assets/hammers/hammer01.png b/assets/hammers/hammer01.png
index a988b9d..33601b7 100644
--- a/assets/hammers/hammer01.png
+++ b/assets/hammers/hammer01.png
Binary files differ
diff --git a/assets/hammers/hammer02.png b/assets/hammers/hammer02.png
index edae92d..f24cdd9 100644
--- a/assets/hammers/hammer02.png
+++ b/assets/hammers/hammer02.png
Binary files differ
diff --git a/assets/hammers/hammer03.png b/assets/hammers/hammer03.png
index 840a1c2..03d1845 100644
--- a/assets/hammers/hammer03.png
+++ b/assets/hammers/hammer03.png
Binary files differ
diff --git a/assets/player/animations.png b/assets/player/animations.png
index 67db143..e1c3930 100644
--- a/assets/player/animations.png
+++ b/assets/player/animations.png
Binary files differ
diff --git a/autoloads/Globals.gd b/autoloads/Globals.gd
index d371dc3..a395865 100644
--- a/autoloads/Globals.gd
+++ b/autoloads/Globals.gd
@@ -1,3 +1,4 @@
extends Node
-var player: Player = null \ No newline at end of file
+var player: Player = null
+var levelmanager: LevelManager = null
diff --git a/autoloads/Utils.gd b/autoloads/Utils.gd
index 0a07436..2b9321b 100644
--- a/autoloads/Utils.gd
+++ b/autoloads/Utils.gd
@@ -2,14 +2,19 @@ extends Node
class_name Util
-func instance_scene_on_main(scene: PackedScene, position: Vector2) -> Node:
- var main := get_tree().current_scene
+static func instance_scene(scene: PackedScene, position: Vector2, on: Node) -> Node:
var instance := scene.instantiate() as Node2D
- main.add_child(instance)
+ on.add_child(instance)
instance.global_position = position
return instance
+func instance_scene_on_main(scene: PackedScene, position: Vector2) -> Node:
+ return Util.instance_scene(scene, position, get_tree().current_scene)
+
+func instance_scene_on_level(scene: PackedScene, position: Vector2) -> Node:
+ return Util.instance_scene(scene, position, Globals.levelmanager.current_level)
+
static func str_vec(vec: Vector2) -> String:
var map := {Vector2.UP: "up", Vector2.DOWN: "down", Vector2.LEFT: "left", Vector2.RIGHT: "right"}
return map.get(vec, str(vec))
diff --git a/classes/Maze.gd b/classes/Maze.gd
index ca86c9d..8d185a8 100644
--- a/classes/Maze.gd
+++ b/classes/Maze.gd
@@ -13,6 +13,11 @@ var _size: Vector2i = Vector2i(6, 6)
var maze := []
+var image: Image = null:
+ get:
+ if not image:
+ image = gen_image()
+ return image
func _init(p_size: Vector2i) -> void:
_size = p_size
@@ -127,7 +132,7 @@ func erase():
break
-func image() -> Image:
+func gen_image() -> Image:
var img := Image.create(_size.x * 3, _size.y * 3, false, Image.FORMAT_L8)
const ALL_DOORS := [Vector2i.UP, Vector2i.DOWN, Vector2i.LEFT, Vector2i.RIGHT]
diff --git a/colliders/hitbox.tscn b/colliders/hitbox.tscn
index 75cacc3..c0b658a 100644
--- a/colliders/hitbox.tscn
+++ b/colliders/hitbox.tscn
@@ -1,4 +1,4 @@
-[gd_scene load_steps=2 format=3 uid="uid://cdpkxaateaqdf"]
+[gd_scene load_steps=2 format=3 uid="uid://ug40hxlkequx"]
[ext_resource type="Script" path="res://colliders/hitbox.gd" id="1_3seao"]
diff --git a/colliders/hittable.gd b/colliders/hittable.gd
index 89090eb..3e75619 100644
--- a/colliders/hittable.gd
+++ b/colliders/hittable.gd
@@ -1,6 +1,7 @@
extends CharacterBody2D
class_name Hittable
+
# @virtual
func hit(_damage: int) -> void:
- pass \ No newline at end of file
+ pass
diff --git a/colliders/hurtbox.gd b/colliders/hurtbox.gd
index df92234..f4872c0 100644
--- a/colliders/hurtbox.gd
+++ b/colliders/hurtbox.gd
@@ -1,5 +1,6 @@
extends Area2D
class_name Hurtbox
+
func _ready() -> void:
- assert(owner is Hittable) \ No newline at end of file
+ assert(owner is Hittable)
diff --git a/colliders/hurtbox.tscn b/colliders/hurtbox.tscn
index 67be79b..0a508a9 100644
--- a/colliders/hurtbox.tscn
+++ b/colliders/hurtbox.tscn
@@ -1,4 +1,4 @@
-[gd_scene load_steps=2 format=3 uid="uid://qliv2erkwokh"]
+[gd_scene load_steps=2 format=3 uid="uid://bgt7m0j1ier74"]
[ext_resource type="Script" path="res://colliders/hurtbox.gd" id="1_4me7n"]
diff --git a/enemys/Enemy.gd b/enemys/Enemy.gd
index 55ce199..6457c8f 100644
--- a/enemys/Enemy.gd
+++ b/enemys/Enemy.gd
@@ -12,8 +12,8 @@ signal died
set(value):
health = clamp(value, 0, max_health)
if health == 0:
- died.emit() # voodoo magic makes this signal connect to die()
- # die()
+ died.emit() # ~~voodoo magic makes this signal connect to die()~~
+ die() # the voodoo magic broke ;-;
func hit(damage: int) -> void:
health -= damage
diff --git a/enemys/Enemy.tscn b/enemys/Enemy.tscn
index 8016a44..9e805a0 100644
--- a/enemys/Enemy.tscn
+++ b/enemys/Enemy.tscn
@@ -1,8 +1,8 @@
-[gd_scene load_steps=4 format=3 uid="uid://baefo17xlk1n1"]
+[gd_scene load_steps=4 format=3 uid="uid://cqssoh4optvhe"]
[ext_resource type="Script" path="res://enemys/Enemy.gd" id="1_rvxwt"]
-[ext_resource type="PackedScene" uid="uid://qliv2erkwokh" path="res://colliders/hurtbox.tscn" id="2_c7rvc"]
-[ext_resource type="PackedScene" uid="uid://cdpkxaateaqdf" path="res://colliders/hitbox.tscn" id="3_cav1d"]
+[ext_resource type="PackedScene" uid="uid://bgt7m0j1ier74" path="res://colliders/hurtbox.tscn" id="2_c7rvc"]
+[ext_resource type="PackedScene" uid="uid://ug40hxlkequx" path="res://colliders/hitbox.tscn" id="3_cav1d"]
[node name="Enemy" type="CharacterBody2D"]
texture_filter = 1
@@ -12,11 +12,14 @@ script = ExtResource("1_rvxwt")
[node name="Sprite" type="Sprite2D" parent="."]
[node name="Collision" type="CollisionShape2D" parent="."]
+visible = false
[node name="Hurtbox" parent="." instance=ExtResource("2_c7rvc")]
+visible = false
collision_layer = 8
[node name="Hitbox" parent="." instance=ExtResource("3_cav1d")]
+visible = false
collision_mask = 4
[editable path="Hurtbox"]
diff --git a/enemys/wrencher.gd b/enemys/wrencher.gd
index cfa44ca..e663457 100644
--- a/enemys/wrencher.gd
+++ b/enemys/wrencher.gd
@@ -4,7 +4,7 @@ extends Enemy
@export var MAX_SPEED := 32
@export var FRICTION := .8
@export var SHOT_COOLDOWN := 1
-@onready @export var muzzle: Node2D
+@onready @export var muzzle: Marker2D
@onready @export var floorcast: RayCast2D
@onready @export var animator: AnimationPlayer
@onready @export var player_cast: ShapeCast2D
@@ -40,7 +40,7 @@ func _physics_process(_delta: float) -> void:
func fire() -> void:
- var hammer: Hammer = Utils.instance_scene_on_main(Utils.get_hammer(), muzzle.global_position)
+ var hammer: Hammer = Utils.instance_scene_on_level(Utils.get_hammer(), muzzle.global_position)
hammer.steer_force = 0.01 # cheat
hammer.target = Globals.player
hammer.direction = up_direction
diff --git a/enemys/wrencher.tscn b/enemys/wrencher.tscn
index 70b7e28..590768a 100644
--- a/enemys/wrencher.tscn
+++ b/enemys/wrencher.tscn
@@ -1,9 +1,9 @@
-[gd_scene load_steps=10 format=3 uid="uid://f7wqdmugs712"]
+[gd_scene load_steps=10 format=3 uid="uid://b0s1su8xjtxdj"]
-[ext_resource type="PackedScene" uid="uid://baefo17xlk1n1" path="res://enemys/Enemy.tscn" id="1_7mo8u"]
+[ext_resource type="PackedScene" uid="uid://cqssoh4optvhe" path="res://enemys/Enemy.tscn" id="1_7mo8u"]
[ext_resource type="Texture2D" uid="uid://bbp683dgbfu76" path="res://assets/enemys/wrencher.png" id="2_0jx2r"]
[ext_resource type="Script" path="res://enemys/wrencher.gd" id="2_ydgi0"]
-[ext_resource type="Shape2D" uid="uid://5mpwir3ab0ff" path="res://enemys/wrencher_collision.tres" id="3_fsg5e"]
+[ext_resource type="Shape2D" path="res://enemys/wrencher_collision.tres" id="3_fsg5e"]
[sub_resource type="Animation" id="Animation_ghcxr"]
length = 0.001
@@ -112,14 +112,16 @@ libraries = {
"": SubResource("AnimationLibrary_bv8p0")
}
-[node name="Muzzle" type="Node2D" parent="." index="5"]
+[node name="Muzzle" type="Marker2D" parent="." index="5"]
position = Vector2(0, -6)
[node name="FloorCast" type="RayCast2D" parent="." index="6"]
+visible = false
position = Vector2(0, -3)
target_position = Vector2(0, 5)
[node name="PlayerCast" type="ShapeCast2D" parent="." index="7"]
+visible = false
position = Vector2(0, -25)
shape = SubResource("RectangleShape2D_j3gtw")
target_position = Vector2(0, -170)
diff --git a/enemys/wrencher_collision.tres b/enemys/wrencher_collision.tres
index 1816089..f7c6c5c 100644
--- a/enemys/wrencher_collision.tres
+++ b/enemys/wrencher_collision.tres
@@ -1,4 +1,4 @@
-[gd_resource type="RectangleShape2D" format=3 uid="uid://5mpwir3ab0ff"]
+[gd_resource type="RectangleShape2D" format=3 uid=""]
[resource]
size = Vector2(16, 10)
diff --git a/fx/double_jump.tscn b/fx/double_jump.tscn
index 45841ac..ff65cf5 100644
--- a/fx/double_jump.tscn
+++ b/fx/double_jump.tscn
@@ -1,9 +1,9 @@
-[gd_scene load_steps=6 format=3 uid="uid://clsdwiyvr2dmc"]
+[gd_scene load_steps=6 format=3 uid="uid://dn2ai1wwutqe5"]
-[ext_resource type="PackedScene" uid="uid://6o1bfy3xhjbm" path="res://fx/fx.tscn" id="1"]
+[ext_resource type="PackedScene" uid="uid://smkugd4xx0vm" path="res://fx/fx.tscn" id="1"]
[ext_resource type="Texture2D" uid="uid://byl1w287mywe" path="res://assets/fx/double_jump.png" id="2"]
-[sub_resource type="Animation" id="1"]
+[sub_resource type="Animation" id="Animation_enwu3"]
resource_name = "Animate"
length = 0.5
tracks/0/type = "value"
@@ -33,7 +33,7 @@ tracks/1/keys = {
}]
}
-[sub_resource type="Animation" id="2"]
+[sub_resource type="Animation" id="Animation_ugiqs"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
@@ -48,10 +48,10 @@ tracks/0/keys = {
"values": [1]
}
-[sub_resource type="AnimationLibrary" id="AnimationLibrary_8xbme"]
+[sub_resource type="AnimationLibrary" id="AnimationLibrary_sfi4e"]
_data = {
-"Animate": SubResource("1"),
-"RESET": SubResource("2")
+"Animate": SubResource("Animation_enwu3"),
+"RESET": SubResource("Animation_ugiqs")
}
[node name="DoubleJumpEffect" instance=ExtResource("1")]
@@ -64,5 +64,5 @@ frame = 1
[node name="AnimationPlayer" parent="." index="1"]
autoplay = "Animate"
libraries = {
-"": SubResource("AnimationLibrary_8xbme")
+"": SubResource("AnimationLibrary_sfi4e")
}
diff --git a/fx/dust.tscn b/fx/dust.tscn
index 8d98c20..d9d5e49 100644
--- a/fx/dust.tscn
+++ b/fx/dust.tscn
@@ -1,10 +1,10 @@
-[gd_scene load_steps=7 format=3 uid="uid://dn3jh3u6xksvj"]
+[gd_scene load_steps=7 format=3 uid="uid://cbbk6t41a267q"]
-[ext_resource type="PackedScene" uid="uid://6o1bfy3xhjbm" path="res://fx/fx.tscn" id="1"]
+[ext_resource type="PackedScene" uid="uid://smkugd4xx0vm" path="res://fx/fx.tscn" id="1"]
[ext_resource type="Texture2D" uid="uid://cuhf1q2aeyoau" path="res://assets/fx/dust.png" id="2"]
[ext_resource type="Script" path="res://fx/dust.gd" id="3"]
-[sub_resource type="Animation" id="1"]
+[sub_resource type="Animation" id="Animation_5r1ca"]
resource_name = "Animate"
length = 0.3
tracks/0/type = "value"
@@ -34,7 +34,7 @@ tracks/1/keys = {
}]
}
-[sub_resource type="Animation" id="2"]
+[sub_resource type="Animation" id="Animation_p3u8k"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
@@ -49,10 +49,10 @@ tracks/0/keys = {
"values": [2]
}
-[sub_resource type="AnimationLibrary" id="AnimationLibrary_60u2x"]
+[sub_resource type="AnimationLibrary" id="AnimationLibrary_74s5a"]
_data = {
-"Animate": SubResource("1"),
-"RESET": SubResource("2")
+"Animate": SubResource("Animation_5r1ca"),
+"RESET": SubResource("Animation_p3u8k")
}
[node name="DustEffect" instance=ExtResource("1")]
@@ -66,5 +66,5 @@ frame = 2
[node name="AnimationPlayer" parent="." index="1"]
autoplay = "Animate"
libraries = {
-"": SubResource("AnimationLibrary_60u2x")
+"": SubResource("AnimationLibrary_74s5a")
}
diff --git a/fx/enemy_death.tscn b/fx/enemy_death.tscn
index 9dd9c1f..c8affdc 100644
--- a/fx/enemy_death.tscn
+++ b/fx/enemy_death.tscn
@@ -1,4 +1,4 @@
-[gd_scene load_steps=2 format=3 uid="uid://b10daeo07yvlv"]
+[gd_scene load_steps=2 format=3 uid="uid://bbvxhy8b1c26q"]
[ext_resource type="Script" path="res://fx/enemy_death.gd" id="1_pgtt6"]
diff --git a/fx/fx.tscn b/fx/fx.tscn
index e5fa217..b42e630 100644
--- a/fx/fx.tscn
+++ b/fx/fx.tscn
@@ -1,4 +1,4 @@
-[gd_scene format=3 uid="uid://6o1bfy3xhjbm"]
+[gd_scene format=3 uid="uid://smkugd4xx0vm"]
[node name="Effect" type="Node2D"]
texture_filter = 1
diff --git a/fx/jump.tscn b/fx/jump.tscn
index 3010854..be04f38 100644
--- a/fx/jump.tscn
+++ b/fx/jump.tscn
@@ -1,9 +1,9 @@
-[gd_scene load_steps=6 format=3 uid="uid://cyihdut47gar"]
+[gd_scene load_steps=6 format=3 uid="uid://cwispjaxo0gvv"]
-[ext_resource type="PackedScene" uid="uid://6o1bfy3xhjbm" path="res://fx/fx.tscn" id="1"]
+[ext_resource type="PackedScene" uid="uid://smkugd4xx0vm" path="res://fx/fx.tscn" id="1"]
[ext_resource type="Texture2D" uid="uid://c7cnh7u3nstnh" path="res://assets/fx/jump.png" id="2"]
-[sub_resource type="Animation" id="1"]
+[sub_resource type="Animation" id="Animation_w7i3f"]
resource_name = "Animate"
length = 0.4
tracks/0/type = "value"
@@ -33,7 +33,7 @@ tracks/1/keys = {
}]
}
-[sub_resource type="Animation" id="2"]
+[sub_resource type="Animation" id="Animation_g27fn"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
@@ -48,10 +48,10 @@ tracks/0/keys = {
"values": [1]
}
-[sub_resource type="AnimationLibrary" id="AnimationLibrary_ity0p"]
+[sub_resource type="AnimationLibrary" id="AnimationLibrary_lqupq"]
_data = {
-"Animate": SubResource("1"),
-"RESET": SubResource("2")
+"Animate": SubResource("Animation_w7i3f"),
+"RESET": SubResource("Animation_g27fn")
}
[node name="JumpEffect" instance=ExtResource("1")]
@@ -65,5 +65,5 @@ frame = 1
[node name="AnimationPlayer" parent="." index="1"]
autoplay = "Animate"
libraries = {
-"": SubResource("AnimationLibrary_ity0p")
+"": SubResource("AnimationLibrary_lqupq")
}
diff --git a/fx/trail.gd b/fx/trail.gd
index dd8f064..43820b3 100644
--- a/fx/trail.gd
+++ b/fx/trail.gd
@@ -28,7 +28,7 @@ extends Line2D
## Optional path to the target node to follow. If not set, the instance follows its parent.
@onready @export var target: Node2D
-var _points_creation_time := []
+var _points_creation_time: PackedFloat32Array = []
var _last_point := Vector2.ZERO
var _clock := 0.0
@@ -70,13 +70,13 @@ func add_timed_point(point: Vector2, time: float) -> void:
func remove_first_point() -> void:
if get_point_count() > 1:
remove_point(0)
- _points_creation_time.pop_front()
+ _points_creation_time.remove_at(0)
## Remove points older than [code]lifetime[/code].
func remove_older() -> void:
for creation_time in _points_creation_time:
- var delta = _clock - creation_time
+ var delta := _clock - creation_time
if delta > lifetime:
remove_first_point()
# Points in `_points_creation_time` are ordered from oldest to newest so as soon as a point
diff --git a/fx/wall_dust.tscn b/fx/wall_dust.tscn
index a062964..d9ff3c2 100644
--- a/fx/wall_dust.tscn
+++ b/fx/wall_dust.tscn
@@ -1,9 +1,9 @@
-[gd_scene load_steps=6 format=3 uid="uid://batisas75bpt0"]
+[gd_scene load_steps=6 format=3 uid="uid://bdutc7drtweyc"]
-[ext_resource type="PackedScene" uid="uid://6o1bfy3xhjbm" path="res://fx/fx.tscn" id="1_4c41e"]
+[ext_resource type="PackedScene" uid="uid://smkugd4xx0vm" path="res://fx/fx.tscn" id="1_4c41e"]
[ext_resource type="Texture2D" uid="uid://cky7hbmx1auqh" path="res://assets/fx/wall_dust.png" id="2_inful"]
-[sub_resource type="Animation" id="1"]
+[sub_resource type="Animation" id="Animation_eq683"]
resource_name = "Animate"
length = 0.5
tracks/0/type = "value"
@@ -33,7 +33,7 @@ tracks/1/keys = {
}]
}
-[sub_resource type="Animation" id="2"]
+[sub_resource type="Animation" id="Animation_s2jmf"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
@@ -48,10 +48,10 @@ tracks/0/keys = {
"values": [1]
}
-[sub_resource type="AnimationLibrary" id="AnimationLibrary_ct4ki"]
+[sub_resource type="AnimationLibrary" id="AnimationLibrary_e1m4r"]
_data = {
-"Animate": SubResource("1"),
-"RESET": SubResource("2")
+"Animate": SubResource("Animation_eq683"),
+"RESET": SubResource("Animation_s2jmf")
}
[node name="WallDustEffect" instance=ExtResource("1_4c41e")]
@@ -64,5 +64,5 @@ frame = 1
[node name="AnimationPlayer" parent="." index="1"]
autoplay = "Animate"
libraries = {
-"": SubResource("AnimationLibrary_ct4ki")
+"": SubResource("AnimationLibrary_e1m4r")
}
diff --git a/hammers/8x14.tres b/hammers/8x14.tres
index 0d53234..da8f9cc 100644
--- a/hammers/8x14.tres
+++ b/hammers/8x14.tres
@@ -1,4 +1,4 @@
-[gd_resource type="RectangleShape2D" format=3 uid="uid://bg3mq5wg3xtiy"]
+[gd_resource type="RectangleShape2D" format=3 uid=""]
[resource]
size = Vector2(6, 12)
diff --git a/hammers/hammer.gd b/hammers/hammer.gd
index 9be86af..395a3b8 100644
--- a/hammers/hammer.gd
+++ b/hammers/hammer.gd
@@ -28,7 +28,8 @@ var hit_player := true
## To hit the enemys
var hit_enemys := false
-@onready var trail: Trail2D = $Trail2D
+@onready var trail := $Trail as Trail2D
+@onready var outline_shader := ($Sprite as Sprite2D).material as ShaderMaterial
func _ready() -> void:
set_collision_mask_value(3, hit_player)
@@ -38,11 +39,15 @@ func seek() -> void:
if target:
direction = direction + (global_position.direction_to(target.global_position) - direction) * steer_force
+func highlight() -> void:
+ outline_shader.set_shader_parameter(&"line_width", .75)
+
+func unhighlight() -> void:
+ outline_shader.set_shader_parameter(&"line_width", 0)
func _physics_process(delta: float) -> void:
seek()
velocity = (direction * acceleration * delta).limit_length(top_speed)
- print(velocity)
rotation = velocity.angle() + PI/2 # face forward
global_position += velocity
diff --git a/hammers/hammer_01.tscn b/hammers/hammer_01.tscn
index 1ba90e4..09de83f 100644
--- a/hammers/hammer_01.tscn
+++ b/hammers/hammer_01.tscn
@@ -1,6 +1,6 @@
-[gd_scene load_steps=3 format=3 uid="uid://bjux3r57ffv8e"]
+[gd_scene load_steps=3 format=3 uid="uid://bsu0i18fxrwhj"]
-[ext_resource type="PackedScene" uid="uid://bciufe82lwiaw" path="res://hammers/hammer_base.tscn" id="1_350hj"]
+[ext_resource type="PackedScene" uid="uid://bimmd1hcj2h0e" path="res://hammers/hammer_base.tscn" id="1_350hj"]
[ext_resource type="Texture2D" uid="uid://dcf5es758pw1n" path="res://assets/hammers/hammer01.png" id="2_sdlv5"]
[node name="Hammer01" instance=ExtResource("1_350hj")]
diff --git a/hammers/hammer_02.tscn b/hammers/hammer_02.tscn
index bcd1390..ec70d27 100644
--- a/hammers/hammer_02.tscn
+++ b/hammers/hammer_02.tscn
@@ -1,13 +1,10 @@
-[gd_scene load_steps=3 format=3 uid="uid://cd85psvumxs8"]
+[gd_scene load_steps=3 format=3 uid="uid://c6ef6eebk03tn"]
-[ext_resource type="PackedScene" uid="uid://bciufe82lwiaw" path="res://hammers/hammer_base.tscn" id="1_vy2k1"]
+[ext_resource type="PackedScene" uid="uid://bimmd1hcj2h0e" path="res://hammers/hammer_base.tscn" id="1_vy2k1"]
[ext_resource type="Texture2D" uid="uid://bcpy0wbrlmqsq" path="res://assets/hammers/hammer02.png" id="2_dmvhv"]
[node name="Hammer02" instance=ExtResource("1_vy2k1")]
-[node name="Trail2D" parent="." index="0"]
-z_index = -1
-
[node name="Sprite" parent="." index="1"]
texture = ExtResource("2_dmvhv")
diff --git a/hammers/hammer_03.tscn b/hammers/hammer_03.tscn
index bdb8ad8..28259e1 100644
--- a/hammers/hammer_03.tscn
+++ b/hammers/hammer_03.tscn
@@ -1,26 +1,26 @@
-[gd_scene load_steps=5 format=3 uid="uid://lsx00k2cigtf"]
+[gd_scene load_steps=5 format=3 uid="uid://c415arbs8q7k7"]
-[ext_resource type="PackedScene" uid="uid://bciufe82lwiaw" path="res://hammers/hammer_base.tscn" id="1_wc0io"]
+[ext_resource type="PackedScene" uid="uid://bimmd1hcj2h0e" path="res://hammers/hammer_base.tscn" id="1_wc0io"]
[ext_resource type="Texture2D" uid="uid://blx67dnlqysnc" path="res://assets/hammers/hammer03.png" id="2_0uj7a"]
-[sub_resource type="RectangleShape2D" id="RectangleShape2D_06tn2"]
+[sub_resource type="RectangleShape2D" id="RectangleShape2D_dgtn7"]
size = Vector2(8, 12)
-[sub_resource type="RectangleShape2D" id="RectangleShape2D_k0ws5"]
+[sub_resource type="RectangleShape2D" id="RectangleShape2D_sbm7t"]
size = Vector2(8, 12)
[node name="Hammer03" instance=ExtResource("1_wc0io")]
-[node name="Sprite" parent="." index="0"]
+[node name="Sprite" parent="." index="1"]
texture = ExtResource("2_0uj7a")
-[node name="Collision" parent="." index="1"]
-shape = SubResource("RectangleShape2D_06tn2")
+[node name="Collision" parent="." index="2"]
+shape = SubResource("RectangleShape2D_dgtn7")
-[node name="Hitbox" parent="." index="2"]
+[node name="Hitbox" parent="." index="3"]
damage = 3
[node name="Collision" parent="Hitbox" index="0"]
-shape = SubResource("RectangleShape2D_k0ws5")
+shape = SubResource("RectangleShape2D_sbm7t")
[editable path="Hitbox"]
diff --git a/hammers/hammer_base.tscn b/hammers/hammer_base.tscn
index 6efe682..aa170b7 100644
--- a/hammers/hammer_base.tscn
+++ b/hammers/hammer_base.tscn
@@ -1,18 +1,25 @@
-[gd_scene load_steps=7 format=3 uid="uid://bciufe82lwiaw"]
+[gd_scene load_steps=9 format=3 uid="uid://bimmd1hcj2h0e"]
-[ext_resource type="PackedScene" uid="uid://cdpkxaateaqdf" path="res://colliders/hitbox.tscn" id="1_kdx5x"]
+[ext_resource type="PackedScene" uid="uid://ug40hxlkequx" path="res://colliders/hitbox.tscn" id="1_kdx5x"]
[ext_resource type="Script" path="res://hammers/hammer.gd" id="1_xp22t"]
-[ext_resource type="Shape2D" uid="uid://bg3mq5wg3xtiy" path="res://hammers/8x14.tres" id="2_tgkvf"]
+[ext_resource type="Shape2D" path="res://hammers/8x14.tres" id="2_tgkvf"]
[ext_resource type="Script" path="res://fx/trail.gd" id="4_boru3"]
-[ext_resource type="Curve" uid="uid://bud8anghktv2f" path="res://hammers/trail_width.tres" id="4_yvshk"]
-[ext_resource type="Gradient" uid="uid://bi35r2i1ue6ub" path="res://hammers/trail_color.tres" id="5_8dqv1"]
+[ext_resource type="Curve" path="res://hammers/trail_width.tres" id="4_yvshk"]
+[ext_resource type="Gradient" path="res://hammers/trail_color.tres" id="5_8dqv1"]
+[ext_resource type="Shader" path="res://hammers/hammer_outline.gdshader" id="5_iyctf"]
+
+[sub_resource type="ShaderMaterial" id="ShaderMaterial_go8fx"]
+shader = ExtResource("5_iyctf")
+shader_parameter/light_offset = 1.0
+shader_parameter/line_width = 0.0
+shader_parameter/sin_frequency = 0.25
[node name="Hammer" type="Area2D"]
texture_filter = 1
collision_layer = 0
script = ExtResource("1_xp22t")
-[node name="Trail2D" type="Line2D" parent="."]
+[node name="Trail" type="Line2D" parent="." node_paths=PackedStringArray("target")]
position = Vector2(0, -6)
z_index = -1
points = PackedVector2Array(0, 0)
@@ -24,16 +31,20 @@ antialiased = true
script = ExtResource("4_boru3")
is_emitting = true
lifetime = 2.0
+target = NodePath("")
+metadata/_edit_lock_ = true
[node name="Sprite" type="Sprite2D" parent="."]
+material = SubResource("ShaderMaterial_go8fx")
[node name="Collision" type="CollisionShape2D" parent="."]
+visible = false
shape = ExtResource("2_tgkvf")
[node name="Hitbox" parent="." instance=ExtResource("1_kdx5x")]
+visible = false
[node name="Collision" parent="Hitbox" index="0"]
-visible = false
shape = ExtResource("2_tgkvf")
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
diff --git a/hammers/hammer_outline.gdshader b/hammers/hammer_outline.gdshader
new file mode 100644
index 0000000..90ce9bc
--- /dev/null
+++ b/hammers/hammer_outline.gdshader
@@ -0,0 +1,36 @@
+/*
+Rainbow outline by @Farfalk and @ThePadDev, July 2021
+
+Apply to canvas items with transparent backgrounds.
+Check that there is sufficient transparent background space for the outline!
+
+CC0 License (but citation is welcome <3)
+*/
+
+shader_type canvas_item;
+
+uniform float line_width : hint_range(0, 20) = 1.0; // thickness of the line
+uniform float sin_frequency : hint_range(0.1, 2.0) = 0.25; // frequency of the rainbow
+uniform float light_offset : hint_range(0.0, 1.0) = 1.0; // this offsets all color channels; if set to 0 only red green and blue colors will be shown.
+
+void fragment() {
+ vec2 size = TEXTURE_PIXEL_SIZE * line_width;
+
+ float outline = texture(TEXTURE, UV + vec2(-size.x, 0)).a;
+ outline += texture(TEXTURE, UV + vec2(0, size.y)).a;
+ outline += texture(TEXTURE, UV + vec2(size.x, 0)).a;
+ outline += texture(TEXTURE, UV + vec2(0, -size.y)).a;
+ outline += texture(TEXTURE, UV + vec2(-size.x, size.y)).a;
+ outline += texture(TEXTURE, UV + vec2(size.x, size.y)).a;
+ outline += texture(TEXTURE, UV + vec2(-size.x, -size.y)).a;
+ outline += texture(TEXTURE, UV + vec2(size.x, -size.y)).a;
+ outline = min(outline, 1.0);
+
+ vec4 animated_line_color = vec4(light_offset + sin(2.0*3.14*sin_frequency*TIME),
+ light_offset + sin(2.0*3.14*sin_frequency*TIME + radians(120.0)),
+ light_offset + sin(2.0*3.14*sin_frequency*TIME + radians(240.0)),
+ 1.0);
+
+ vec4 color = texture(TEXTURE, UV);
+ COLOR = mix(color, animated_line_color, outline - color.a);
+} \ No newline at end of file
diff --git a/hammers/trail_color.tres b/hammers/trail_color.tres
index 3a06925..e689b6b 100644
--- a/hammers/trail_color.tres
+++ b/hammers/trail_color.tres
@@ -1,4 +1,4 @@
-[gd_resource type="Gradient" format=3 uid="uid://bi35r2i1ue6ub"]
+[gd_resource type="Gradient" format=3 uid=""]
[resource]
offsets = PackedFloat32Array(0.0795756, 0.331565, 0.901857)
diff --git a/hammers/trail_width.tres b/hammers/trail_width.tres
index fd6f48e..247acff 100644
--- a/hammers/trail_width.tres
+++ b/hammers/trail_width.tres
@@ -1,4 +1,4 @@
-[gd_resource type="Curve" format=3 uid="uid://bud8anghktv2f"]
+[gd_resource type="Curve" format=3 uid=""]
[resource]
bake_resolution = 20
diff --git a/levels/Level.gd b/levels/Level.gd
index 70afe3e..1d70698 100644
--- a/levels/Level.gd
+++ b/levels/Level.gd
@@ -15,13 +15,21 @@ const ALL_DOORS := [Vector2i.UP, Vector2i.DOWN, Vector2i.LEFT, Vector2i.RIGHT]
const rot_map := {Vector2i.LEFT: PI, Vector2i.RIGHT: 0, Vector2i.DOWN: PI / 2, Vector2i.UP: -PI / 2} # 180 # 90 # -90
-@onready var enemys := $Enemys.get_children()
-@onready var enemyqty := $Enemys.get_child_count()
+var completed := false:
+ set(value):
+ if not is_inside_tree() and value == true:
+ completed = value
+ else:
+ push_error("no")
+
+@onready var enemys := $Enemys.get_children() if not completed else []
+@onready var enemyqty := enemys.size() if not completed else 0
@onready var has_enemys := enemyqty != 0
@onready var blockdoors: Node2D
@onready var doors: Node2D = create_node(&"doors")
+
## Utility fuction to create a [Node2D]
func create_node(p_name: StringName) -> Node2D:
var n := Node2D.new()
@@ -34,12 +42,15 @@ func create_node(p_name: StringName) -> Node2D:
func _ready():
var wall_array := Maze.tile_4b_to_wall_array(enabled_walls)
+ if completed:
+ ($Enemys as Node2D).queue_free()
if len(wall_array) != 4:
var door_array := Util.sub(ALL_DOORS, wall_array)
if Vector2i.DOWN in door_array:
+ var n := create_node(&"one_way_platform")
+ n.position = Vector2(128, 243)
var p: OneWayPlatform = OneWayPlatform_scn.instantiate()
- p.position = Vector2(128, 243)
- call_deferred(&"add_child", p)
+ n.call_deferred(&"add_child", p)
if has_enemys:
blockdoors = create_node(&"block_doors")
@@ -52,7 +63,6 @@ func _ready():
for enemy in enemys:
enemy.died.connect(_on_enemy_died)
-
## Add a [Door] for given direction.
func add_door(dir: Vector2i) -> Door:
var d := Door_scn.instantiate()
diff --git a/levels/Level.tscn b/levels/Level.tscn
index ad412ee..502887a 100644
--- a/levels/Level.tscn
+++ b/levels/Level.tscn
@@ -1,7 +1,7 @@
-[gd_scene load_steps=3 format=3 uid="uid://cflva11kyp5ui"]
+[gd_scene load_steps=3 format=3 uid="uid://dxx21fiom4ef1"]
[ext_resource type="Script" path="res://levels/Level.gd" id="1_cubc7"]
-[ext_resource type="TileSet" uid="uid://dsw8frlrcnbi8" path="res://world/tiles.tres" id="1_r867i"]
+[ext_resource type="TileSet" uid="uid://dhq32uplaxvpl" path="res://world/tiles.tres" id="1_r867i"]
[node name="Level" type="TileMap"]
texture_filter = 1
diff --git a/levels/LevelManager.gd b/levels/LevelManager.gd
index d7c905c..2d55d36 100644
--- a/levels/LevelManager.gd
+++ b/levels/LevelManager.gd
@@ -3,35 +3,75 @@ class_name LevelManager
signal world_generated(maze: Maze)
+## One map to rule them all
var map := []
-const lvl_path_fmt := "res://levels/rand/%s.tscn"
-@export var levels: Array[PackedScene]
+## The maze the map is generated from
+var maze: Maze = null
+
+## Stores the levels that the player has completed--killed all enemys--
+## so that we can spawn the level without enemys when the palyer goes back
+var completed_levels: Array[Vector2i] = []
+
+## Maze size
@export var size := Vector2i(6, 6)
-@export var current_level: TileMap # ASSIGN TO START
+
+## ASSIGN TO Start.tscn
+@export var current_level: TileMap
+@export var start: PackedScene
@export var player: Player
-@onready var main := get_parent()
+@onready var main := get_parent() as Node2D
var lvl_position := Vector2i(-1, -1)
+
+## Timer used for debouncing multiple door enters. (some kind of physics bug there is probably a tracker for but i havent found it)
var t: SceneTreeTimer
-var sorted := [[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]] # Array[PackedSceneArray] [[0..][1..]...[15..]]
+@export var levels: Array[PackedScene]
+
+## type: PackedScene[15][∞]
+var sorted := [[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]
+
+func _init() -> void:
+ Globals.levelmanager = self
+
+func _exit_tree() -> void:
+ Globals.levelmanager = null
+func _ready() -> void:
+ gen_map()
+ lvl_position = size / 2
+ Events.change_level.connect(go)
+ print_map_pretty()
+## Goes to the next room in [param to] direction.
func go(to: Vector2i) -> void:
+ completed_levels.append(lvl_position)
if t and t.time_left > 0:
print("skipping door enter")
return
t = get_tree().create_timer(0.1)
lvl_position += to
current_level.queue_free()
- current_level = map[lvl_position.y][lvl_position.x].instantiate()
+ current_level = map[lvl_position.y][lvl_position.x].instantiate() as TileMap
var v := Vector2i(128, 128) # center
player.position = Vector2(v - (v * to)).move_toward(v, 24)
player.velocity = Vector2.ZERO
- prints("welcome to", current_level.name)
main.call_deferred(&"add_child", current_level)
+ if lvl_position in completed_levels:
+ current_level.completed = true
+ prints("welcome back to", current_level.name)
+ else:
+ prints("welcome to", current_level.name)
-
+## Prints out the map prettily.
+## eg: [codeblock]
+## 14 16 04 08 08 10
+## 15 04 07 04 04 06
+## 12 09 12 05 11 05
+## 15 08 07 St 05 13
+## 12 08 06 15 02 05
+## 15 08 07 08 07 09
+## [/codeblock]
func print_map_pretty() -> void:
var string := ""
for row in map:
@@ -40,25 +80,19 @@ func print_map_pretty() -> void:
string += "\n"
print(string)
-
-# split levels into https://kidscancode.org/blog/img/cells_4bit.png
+## Split levels into [url=https://kidscancode.org/blog/img/cells_4bit.png]4bit wall[/url] groups.
func sort_levels():
for level in levels:
- var n: int = 0 if level.get_state().get_node_property_count(0) == 1 else level.get_state().get_node_property_value(0,1)
+ # property idx 1 is the enabled walls
+ # if prop is not overriden, default to 0
+ var n: int = 0 if level.get_state().get_node_property_count(0) == 1 else level.get_state().get_node_property_value(0, 1)
sorted[n].append(level)
-
-func _ready() -> void:
- gen_map()
- lvl_position = size / 2
- Events.change_level.connect(go)
- print_map_pretty()
-
-
+## Generates the maze.
func gen_map() -> void:
sort_levels()
- var maze := Maze.new(size)
- maze.image().save_png("res://maze.png")
+ maze = Maze.new(size)
+ maze.image.save_png("res://maze.png")
lvl_position = size / 2
map.clear()
for row in maze.maze:
@@ -66,5 +100,5 @@ func gen_map() -> void:
for i in row:
map_row.append(sorted[i][randi() % len(sorted[i])])
map.append(map_row)
- map[lvl_position.x][lvl_position.y] = preload("res://levels/Start.tscn")
+ map[lvl_position.x][lvl_position.y] = start
world_generated.emit(maze)
diff --git a/levels/Start.gd b/levels/Start.gd
index 4f48edc..0f9f251 100644
--- a/levels/Start.gd
+++ b/levels/Start.gd
@@ -1,12 +1,11 @@
extends Level
-@onready var lvl_manager = $"../LevelManager"
-
func _ready() -> void:
- var maze: Maze = get_parent().maze
+ var lm: LevelManager = Globals.levelmanager
+ var maze: Maze = lm.maze
if !maze:
- maze = await lvl_manager.world_generated
- enabled_walls = (maze.get_cellv(lvl_manager.size / 2))
+ maze = await lm.world_generated
+ enabled_walls = (maze.get_cellv(lm.size / 2))
const wm := {
Vector2i.UP: [Vector2i(7, 0), Vector2i(8, 0)],
Vector2i.DOWN: [Vector2i(7, 15), Vector2i(8, 15)],
diff --git a/levels/Start.tscn b/levels/Start.tscn
index a85c053..f3ab013 100644
--- a/levels/Start.tscn
+++ b/levels/Start.tscn
@@ -1,6 +1,6 @@
-[gd_scene load_steps=3 format=3]
+[gd_scene load_steps=3 format=3 uid="uid://dqxnsdq67j23x"]
-[ext_resource type="PackedScene" uid="uid://h2yl2s2kudv8" path="res://levels/Level.tscn" id="1_qw36g"]
+[ext_resource type="PackedScene" uid="uid://dxx21fiom4ef1" path="res://levels/Level.tscn" id="1_qw36g"]
[ext_resource type="Script" path="res://levels/Start.gd" id="2_dhcq0"]
[node name="Start" instance=ExtResource("1_qw36g")]
diff --git a/levels/rand/01.tscn b/levels/rand/01.tscn
index 9231178..2f4ea78 100644
--- a/levels/rand/01.tscn
+++ b/levels/rand/01.tscn
@@ -1,6 +1,14 @@
-[gd_scene load_steps=2 format=3]
+[gd_scene load_steps=3 format=3 uid="uid://bujj6au21fw2"]
-[ext_resource type="PackedScene" uid="uid://h2yl2s2kudv8" path="res://levels/Level.tscn" id="1_gxkva"]
+[ext_resource type="PackedScene" uid="uid://dxx21fiom4ef1" path="res://levels/Level.tscn" id="1_gxkva"]
+[ext_resource type="PackedScene" uid="uid://b0s1su8xjtxdj" path="res://enemys/wrencher.tscn" id="2_02iql"]
[node name="01" instance=ExtResource("1_gxkva")]
layer_0/tile_data = PackedInt32Array(131072, 0, 1, 196608, 0, 1, 262144, 262144, 1, 327680, 196608, 1, 393216, 196608, 2, 589824, 196608, 0, 655360, 196608, 1, 720896, 196608, 1, 786432, 196608, 1, 851968, 196608, 1, 917504, 196608, 1, 983040, 262144, 3, 983041, 65536, 3, 2, 65536, 0, 983042, 65536, 3, 3, 65536, 0, 983043, 65536, 3, 4, 327680, 0, 983044, 65536, 3, 5, 65536, 3, 983045, 65536, 3, 6, 131072, 3, 983046, 131072, 3, 9, 0, 3, 983049, 0, 3, 10, 65536, 3, 983050, 65536, 3, 11, 65536, 3, 983051, 65536, 3, 12, 393216, 0, 983052, 65536, 3, 13, 65536, 0, 983053, 65536, 3, 14, 65536, 0, 983054, 65536, 3, 15, 131072, 0, 65551, 131072, 1, 131087, 131072, 1, 196623, 131072, 1, 262159, 458752, 1, 327695, 196608, 1, 393231, 196608, 2, 589839, 196608, 0, 655375, 196608, 1, 720911, 196608, 1, 786447, 196608, 1, 851983, 196608, 1, 917519, 196608, 1, 983055, 458752, 3, 65536, 0, 1, 0, 0, 0, 1, 65536, 0, 65537, 65536, 1, 131073, 65536, 1, 196609, 65536, 1, 262145, 65536, 2, 262146, 131072, 2, 196610, 131072, 1, 131074, 327680, 1, 65538, 65536, 1, 65539, 65536, 1, 131075, 65536, 2, 65540, 131072, 1, 131076, 458752, 1, 196612, 196608, 2, 65548, 0, 1, 131084, 0, 1, 196620, 262144, 1, 262156, 196608, 2, 131085, 65536, 1, 65549, 65536, 1, 65550, 65536, 1, 196621, 65536, 2, 196622, 393216, 1, 131086, 65536, 1, 262158, 0, 2, 524294, 65536, 1, 524295, 65536, 1, 524296, 65536, 1, 458760, 65536, 1, 458761, 65536, 1, 458762, 327680, 2, 458763, 131072, 0, 524298, 327680, 1, 589834, 131072, 2, 524297, 65536, 1, 458759, 65536, 1, 458758, 65536, 1, 589831, 65536, 2, 393223, 65536, 0, 393222, 65536, 0, 393221, 0, 0, 458757, 393216, 2, 524293, 393216, 1, 524292, 0, 2, 458756, 0, 0, 393226, 131072, 0, 393225, 65536, 0, 393224, 65536, 0, 589829, 0, 2, 589830, 65536, 2, 589832, 65536, 2, 589833, 65536, 2, 524299, 131072, 2, 917518, 327681, 0, 393220, 1, 0, 917516, 196609, 0, 917517, 262145, 0, 851982, 196609, 0)
+
+[node name="Wrencher" parent="Enemys" index="0" instance=ExtResource("2_02iql")]
+position = Vector2(16, 192)
+rotation = 1.57079
+
+[node name="Wrencher2" parent="Enemys" index="1" instance=ExtResource("2_02iql")]
+position = Vector2(144, 96)
diff --git a/levels/rand/02.tscn b/levels/rand/02.tscn
index ab81e0d..b057da4 100644
--- a/levels/rand/02.tscn
+++ b/levels/rand/02.tscn
@@ -1,6 +1,11 @@
-[gd_scene load_steps=2 format=3]
+[gd_scene load_steps=3 format=3 uid="uid://yl0khissgys3"]
-[ext_resource type="PackedScene" uid="uid://h2yl2s2kudv8" path="res://levels/Level.tscn" id="1_br7j7"]
+[ext_resource type="PackedScene" uid="uid://dxx21fiom4ef1" path="res://levels/Level.tscn" id="1_br7j7"]
+[ext_resource type="PackedScene" uid="uid://b0s1su8xjtxdj" path="res://enemys/wrencher.tscn" id="2_6rw4g"]
[node name="02" instance=ExtResource("1_br7j7")]
layer_0/tile_data = PackedInt32Array(131072, 196608, 1, 196608, 196608, 1, 262144, 196608, 1, 327680, 196608, 1, 393216, 196608, 2, 589824, 196608, 0, 655360, 196608, 1, 720896, 196608, 1, 786432, 196608, 1, 851968, 196608, 1, 917504, 196608, 1, 983040, 262144, 3, 983041, 65536, 3, 2, 65536, 3, 983042, 65536, 3, 3, 65536, 3, 983043, 65536, 3, 4, 65536, 3, 983044, 65536, 3, 5, 65536, 3, 983045, 65536, 3, 6, 131072, 3, 393222, 65536, 1, 524294, 65536, 1, 589830, 65536, 1, 983046, 131072, 3, 524295, 65536, 1, 589831, 65536, 1, 393224, 65536, 1, 458760, 65536, 1, 524296, 65536, 1, 589832, 65536, 1, 9, 0, 3, 393225, 65536, 1, 458761, 65536, 1, 524297, 65536, 1, 589833, 65536, 1, 983049, 0, 3, 10, 65536, 3, 983050, 65536, 3, 11, 65536, 3, 983051, 65536, 3, 12, 65536, 3, 983052, 65536, 3, 13, 65536, 3, 983053, 65536, 3, 14, 65536, 3, 983054, 65536, 3, 15, 458752, 0, 65551, 196608, 1, 131087, 196608, 1, 196623, 196608, 1, 262159, 196608, 1, 327695, 196608, 1, 393231, 196608, 2, 589839, 196608, 0, 655375, 196608, 1, 720911, 196608, 1, 786447, 196608, 1, 851983, 196608, 1, 917519, 196608, 1, 983055, 458752, 3, 65536, 196608, 1, 0, 262144, 0, 1, 65536, 3, 458758, 65536, 1, 393223, 65536, 1, 458759, 65536, 1, 786444, 131072, 2, 720908, 131072, 1, 655372, 131072, 1, 589836, 131072, 1, 524300, 131072, 1, 458764, 131072, 1, 393228, 131072, 1, 327692, 131072, 1, 262156, 131072, 1, 786443, 65536, 2, 720907, 65536, 1, 655371, 65536, 1, 589835, 65536, 1, 524299, 65536, 1, 458763, 65536, 1, 393227, 65536, 1, 327691, 65536, 1, 262155, 65536, 1, 786442, 65536, 2, 720906, 65536, 1, 655370, 65536, 1, 589834, 65536, 1, 524298, 65536, 1, 458762, 65536, 1, 393226, 65536, 1, 327690, 65536, 1, 262154, 65536, 1, 786441, 65536, 2, 720905, 65536, 1, 655369, 65536, 1, 327689, 65536, 1, 262153, 65536, 1, 786440, 65536, 2, 720904, 65536, 1, 655368, 65536, 1, 327688, 65536, 1, 262152, 65536, 1, 786439, 65536, 2, 720903, 65536, 1, 655367, 65536, 1, 327687, 65536, 1, 262151, 65536, 1, 786438, 65536, 2, 720902, 65536, 1, 655366, 65536, 1, 327686, 65536, 1, 262150, 65536, 1, 786437, 65536, 2, 720901, 65536, 1, 655365, 65536, 1, 589829, 65536, 1, 524293, 65536, 1, 458757, 65536, 1, 393221, 65536, 1, 327685, 65536, 1, 262149, 65536, 1, 786436, 65536, 2, 720900, 65536, 1, 655364, 65536, 1, 589828, 65536, 1, 524292, 65536, 1, 458756, 65536, 1, 393220, 65536, 1, 327684, 65536, 1, 262148, 65536, 1, 196620, 131072, 0, 196619, 65536, 0, 196618, 65536, 0, 196617, 65536, 0, 196616, 65536, 0, 196615, 65536, 0, 196614, 65536, 0, 196613, 65536, 0, 196612, 65536, 0, 786435, 0, 2, 720899, 0, 1, 655363, 0, 1, 589827, 0, 1, 524291, 0, 1, 458755, 0, 1, 393219, 0, 1, 327683, 0, 1, 262147, 0, 1, 196611, 0, 0)
+
+[node name="Wrencher" parent="Enemys" index="0" instance=ExtResource("2_6rw4g")]
+position = Vector2(32, 16)
+rotation = -3.14159
diff --git a/levels/rand/03.tscn b/levels/rand/03.tscn
index 703e0cb..cf56f7e 100644
--- a/levels/rand/03.tscn
+++ b/levels/rand/03.tscn
@@ -1,6 +1,10 @@
-[gd_scene load_steps=2 format=3]
+[gd_scene load_steps=3 format=3 uid="uid://cc2cke0h0rq2"]
-[ext_resource type="PackedScene" uid="uid://h2yl2s2kudv8" path="res://levels/Level.tscn" id="1_tj6sj"]
+[ext_resource type="PackedScene" uid="uid://dxx21fiom4ef1" path="res://levels/Level.tscn" id="1_tj6sj"]
+[ext_resource type="PackedScene" uid="uid://b0s1su8xjtxdj" path="res://enemys/wrencher.tscn" id="2_kmhwi"]
[node name="03" instance=ExtResource("1_tj6sj")]
layer_0/tile_data = PackedInt32Array(131072, 0, 1, 196608, 0, 1, 262144, 0, 1, 327680, 262144, 1, 393216, 196608, 2, 589824, 196608, 0, 655360, 262144, 2, 720896, 0, 1, 786432, 0, 1, 851968, 0, 1, 917504, 0, 1, 983040, 0, 2, 983041, 65536, 2, 2, 65536, 0, 983042, 65536, 2, 3, 65536, 0, 983043, 65536, 2, 4, 65536, 0, 983044, 65536, 2, 5, 327680, 0, 983045, 65536, 2, 6, 131072, 3, 983046, 131072, 2, 9, 0, 0, 983049, 0, 2, 10, 65536, 0, 983050, 65536, 2, 11, 65536, 0, 983051, 65536, 2, 12, 65536, 0, 983052, 65536, 2, 13, 65536, 0, 983053, 65536, 2, 14, 65536, 0, 983054, 65536, 2, 15, 131072, 0, 65551, 131072, 1, 131087, 131072, 1, 196623, 131072, 1, 262159, 131072, 1, 327695, 458752, 1, 393231, 196608, 2, 589839, 131072, 0, 655375, 131072, 1, 720911, 131072, 1, 786447, 131072, 1, 851983, 131072, 1, 917519, 131072, 1, 983055, 131072, 2, 65536, 0, 1, 0, 0, 0, 1, 65536, 0, 917505, 65536, 1, 917506, 65536, 1, 917507, 65536, 1, 917508, 65536, 1, 917509, 65536, 1, 917510, 131072, 1, 851974, 131072, 0, 851973, 327680, 2, 851972, 65536, 1, 851971, 65536, 1, 851970, 65536, 1, 851969, 65536, 1, 786433, 65536, 1, 720897, 65536, 1, 655361, 65536, 0, 786434, 65536, 1, 720898, 65536, 1, 655362, 65536, 0, 786435, 65536, 1, 720899, 65536, 1, 655363, 65536, 0, 655364, 65536, 0, 655365, 131072, 0, 720901, 131072, 1, 720900, 65536, 1, 786436, 65536, 1, 786437, 131072, 1, 917513, 0, 0, 917514, 65536, 0, 917515, 65536, 0, 917516, 393216, 2, 851980, 0, 0, 917517, 65536, 1, 851981, 393216, 2, 851982, 65536, 1, 917518, 65536, 1, 786445, 0, 0, 786446, 393216, 2, 720910, 0, 1, 655374, 0, 1, 589838, 0, 0, 65546, 393216, 1, 131082, 0, 1, 131083, 65536, 1, 196619, 393216, 1, 196620, 65536, 1, 262156, 65536, 1, 327692, 393216, 1, 327693, 327680, 1, 327694, 65536, 2, 262158, 65536, 1, 196622, 65536, 1, 131086, 65536, 1, 65549, 65536, 1, 131085, 65536, 1, 131084, 65536, 1, 65548, 65536, 1, 196621, 65536, 1, 65547, 65536, 1, 262157, 65536, 1, 65550, 65536, 1, 393229, 131072, 2, 393228, 0, 2, 327691, 0, 2, 262155, 0, 1, 196618, 0, 2, 65545, 0, 2, 65538, 65536, 1, 131075, 65536, 1, 196611, 327680, 1, 196612, 131072, 2, 131076, 327680, 1, 65541, 131072, 1, 131077, 131072, 2, 196610, 65536, 1, 65537, 65536, 1, 131074, 65536, 1, 131073, 65536, 1, 196609, 65536, 1, 262145, 65536, 1, 65539, 65536, 1, 65540, 65536, 1, 262147, 131072, 2, 262146, 327680, 1, 327682, 131072, 2, 327681, 65536, 2, 393222, 393216, 4, 458758, 0, 2, 458759, 65536, 2, 458760, 458752, 1, 524296, 196608, 2, 393224, 131072, 0, 393223, 327680, 2, 393221, 0, 3, 327686, 0, 0, 327687, 131072, 0, 655370, 131072, 0, 720906, 131072, 2, 720905, 0, 2, 655369, 0, 0, 524299, 131072, 3, 524298, 0, 3, 196616, 131072, 3, 196615, 0, 3)
+
+[node name="Wrencher" parent="Enemys" index="0" instance=ExtResource("2_kmhwi")]
+position = Vector2(64, 160)
diff --git a/levels/rand/04.tscn b/levels/rand/04.tscn
index c56032e..95da5b2 100644
--- a/levels/rand/04.tscn
+++ b/levels/rand/04.tscn
@@ -1,7 +1,12 @@
-[gd_scene load_steps=2 format=3]
+[gd_scene load_steps=3 format=3 uid="uid://byccymelwvur8"]
-[ext_resource type="PackedScene" uid="uid://h2yl2s2kudv8" path="res://levels/Level.tscn" id="1_twiom"]
+[ext_resource type="PackedScene" uid="uid://dxx21fiom4ef1" path="res://levels/Level.tscn" id="1_twiom"]
+[ext_resource type="PackedScene" uid="uid://b0s1su8xjtxdj" path="res://enemys/wrencher.tscn" id="2_kvkn2"]
[node name="04" instance=ExtResource("1_twiom")]
layer_0/tile_data = PackedInt32Array(131072, 196608, 1, 196608, 196608, 1, 262144, 196608, 1, 327680, 196608, 1, 393216, 196608, 2, 589824, 196608, 0, 655360, 196608, 1, 720896, 196608, 1, 786432, 196608, 1, 851968, 262144, 2, 917504, 0, 1, 983040, 0, 2, 983041, 65536, 2, 2, 65536, 3, 983042, 65536, 2, 3, 393216, 0, 983043, 65536, 2, 4, 65536, 0, 983044, 327680, 3, 5, 65536, 0, 983045, 65536, 3, 6, 65536, 0, 393222, 0, 1, 524294, 393216, 1, 589830, 0, 2, 983046, 131072, 3, 524295, 65536, 1, 589831, 393216, 1, 393224, 65536, 1, 458760, 65536, 1, 524296, 65536, 1, 589832, 327680, 1, 9, 327680, 0, 393225, 65536, 1, 458761, 65536, 1, 524297, 65536, 1, 589833, 65536, 2, 983049, 0, 3, 10, 65536, 3, 983050, 65536, 3, 11, 393216, 0, 983051, 65536, 3, 12, 65536, 0, 983052, 65536, 3, 13, 65536, 0, 983053, 65536, 3, 14, 65536, 0, 983054, 65536, 3, 15, 131072, 0, 65551, 131072, 1, 131087, 131072, 1, 196623, 131072, 1, 262159, 458752, 1, 327695, 196608, 1, 393231, 196608, 2, 589839, 196608, 0, 655375, 196608, 1, 720911, 196608, 1, 786447, 196608, 1, 851983, 196608, 1, 917519, 196608, 1, 983055, 458752, 3, 65536, 196608, 1, 0, 262144, 0, 1, 65536, 3, 458758, 393216, 2, 393223, 65536, 1, 458759, 65536, 1, 8, 65536, 0, 7, 65536, 0, 65542, 65536, 1, 131078, 65536, 1, 196614, 393216, 1, 262150, 0, 1, 327686, 0, 1, 327687, 65536, 1, 327688, 65536, 1, 327689, 65536, 1, 262153, 327680, 2, 196617, 131072, 1, 131081, 131072, 1, 65545, 131072, 1, 65544, 65536, 1, 65543, 65536, 1, 131079, 65536, 1, 196615, 65536, 1, 262151, 65536, 1, 196616, 65536, 1, 131080, 65536, 1, 262152, 65536, 1, 65539, 0, 2, 65540, 393216, 1, 131076, 0, 2, 131077, 393216, 1, 196613, 0, 2, 65541, 65536, 1, 262158, 0, 2, 196622, 393216, 1, 196621, 0, 2, 131085, 393216, 1, 131084, 0, 2, 65548, 393216, 1, 65547, 0, 2, 65549, 65536, 1, 65550, 65536, 1, 131086, 65536, 1, 327690, 327680, 2, 327691, 131072, 0, 393227, 327680, 2, 458763, 65536, 1, 458764, 327680, 4, 393228, 131072, 0, 524300, 131072, 2, 524299, 327680, 1, 524298, 65536, 1, 589834, 65536, 2, 589835, 131072, 2, 458762, 65536, 1, 393226, 65536, 1, 458765, 131072, 3, 262154, 131072, 0, 458757, 0, 0, 524293, 0, 2, 655367, 0, 2, 655368, 131072, 2, 917516, 196609, 0, 917517, 262145, 0, 851982, 196609, 0, 917518, 327681, 0, 917505, 65536, 1, 917506, 327680, 2, 851969, 65536, 0, 851970, 131072, 0, 917507, 65536, 0, 917508, 131072, 0)
enabled_walls = 1.0
+
+[node name="Wrencher" parent="Enemys" index="0" instance=ExtResource("2_kvkn2")]
+position = Vector2(32, 16)
+rotation = 3.14159
diff --git a/levels/rand/05.tscn b/levels/rand/05.tscn
index 0f37385..984c77c 100644
--- a/levels/rand/05.tscn
+++ b/levels/rand/05.tscn
@@ -1,7 +1,12 @@
-[gd_scene load_steps=2 format=3]
+[gd_scene load_steps=3 format=3 uid="uid://hr0ueup48w71"]
-[ext_resource type="PackedScene" uid="uid://h2yl2s2kudv8" path="res://levels/Level.tscn" id="1_6wqlc"]
+[ext_resource type="PackedScene" uid="uid://dxx21fiom4ef1" path="res://levels/Level.tscn" id="1_6wqlc"]
+[ext_resource type="PackedScene" uid="uid://b0s1su8xjtxdj" path="res://enemys/wrencher.tscn" id="2_biat4"]
[node name="05" instance=ExtResource("1_6wqlc")]
layer_0/tile_data = PackedInt32Array(131072, 196608, 1, 196608, 196608, 1, 262144, 196608, 1, 327680, 196608, 1, 393216, 196608, 2, 589824, 196608, 0, 655360, 196608, 1, 720896, 196608, 1, 786432, 196608, 1, 851968, 196608, 1, 917504, 196608, 1, 983040, 262144, 3, 983041, 65536, 3, 2, 65536, 3, 983042, 65536, 3, 3, 65536, 3, 983043, 65536, 3, 4, 65536, 3, 983044, 65536, 3, 5, 65536, 3, 983045, 65536, 3, 6, 131072, 3, 393222, 589824, 0, 524294, 0, 1, 589830, 0, 2, 983046, 131072, 3, 524295, 65536, 1, 589831, 65536, 2, 393224, 65536, 0, 458760, 65536, 1, 524296, 65536, 1, 589832, 65536, 2, 9, 0, 3, 393225, 131072, 0, 458761, 131072, 1, 524297, 327680, 2, 589833, 393216, 1, 983049, 0, 3, 10, 65536, 3, 983050, 65536, 3, 11, 65536, 3, 983051, 393216, 3, 12, 65536, 3, 983052, 65536, 2, 13, 65536, 3, 983053, 65536, 2, 14, 65536, 3, 983054, 65536, 2, 15, 458752, 0, 65551, 196608, 1, 131087, 196608, 1, 196623, 196608, 1, 262159, 196608, 1, 327695, 196608, 1, 393231, 196608, 1, 589839, 196608, 1, 655375, 196608, 1, 720911, 196608, 1, 786447, 458752, 2, 851983, 131072, 1, 917519, 131072, 1, 983055, 131072, 2, 65536, 196608, 1, 0, 262144, 0, 1, 65536, 3, 458758, 0, 1, 393223, 65536, 0, 458759, 65536, 1, 458767, 196608, 1, 524303, 196608, 1, 917518, 65536, 1, 917517, 65536, 1, 851981, 393216, 2, 851982, 65536, 1, 786446, 65536, 0, 786445, 0, 0, 851980, 0, 0, 917516, 393216, 2, 917515, 0, 0, 131074, 0, 0, 196610, 0, 1, 262146, 0, 2, 262147, 393216, 1, 262148, 327680, 2, 196612, 131072, 1, 196611, 65536, 1, 131075, 65536, 0, 131076, 131072, 0, 262149, 65536, 0, 327685, 393216, 1, 327686, 131072, 1, 262150, 131072, 0, 393221, 0, 2, 327684, 65536, 2, 327683, 0, 2, 655369, 0, 1, 720905, 0, 2, 720906, 131072, 2, 655370, 131072, 1, 589834, 131072, 1, 524298, 131072, 0, 720900, 131072, 0, 720899, 0, 0, 786435, 0, 2, 786436, 131072, 2)
enabled_walls = 2.0
+
+[node name="Wrencher" parent="Enemys" index="0" instance=ExtResource("2_biat4")]
+position = Vector2(240, 96)
+rotation = -1.57079
diff --git a/levels/rand/06.tscn b/levels/rand/06.tscn
index af989a6..cb07e57 100644
--- a/levels/rand/06.tscn
+++ b/levels/rand/06.tscn
@@ -1,6 +1,6 @@
-[gd_scene load_steps=2 format=3]
+[gd_scene load_steps=2 format=3 uid="uid://887jva236kjn"]
-[ext_resource type="PackedScene" uid="uid://h2yl2s2kudv8" path="res://levels/Level.tscn" id="1_m26rk"]
+[ext_resource type="PackedScene" uid="uid://dxx21fiom4ef1" path="res://levels/Level.tscn" id="1_m26rk"]
[node name="06" instance=ExtResource("1_m26rk")]
layer_0/tile_data = PackedInt32Array(131072, 262144, 1, 196608, 196608, 1, 262144, 196608, 1, 327680, 196608, 1, 393216, 196608, 2, 589824, 196608, 0, 655360, 196608, 1, 720896, 196608, 1, 786432, 196608, 1, 851968, 196608, 1, 917504, 196608, 1, 983040, 262144, 3, 983041, 65536, 3, 2, 65536, 0, 983042, 65536, 3, 3, 65536, 0, 983043, 65536, 3, 4, 65536, 0, 983044, 65536, 3, 5, 65536, 0, 983045, 65536, 3, 6, 65536, 0, 393222, 393216, 1, 524294, 0, 1, 589830, 0, 2, 983046, 131072, 3, 524295, 65536, 1, 589831, 65536, 2, 393224, 65536, 1, 458760, 65536, 1, 524296, 65536, 1, 589832, 65536, 2, 9, 65536, 0, 393225, 65536, 1, 458761, 65536, 1, 524297, 65536, 1, 589833, 65536, 2, 983049, 0, 3, 10, 65536, 0, 983050, 65536, 3, 11, 65536, 0, 983051, 65536, 3, 12, 65536, 0, 983052, 65536, 3, 13, 65536, 0, 983053, 65536, 3, 14, 65536, 0, 983054, 393216, 3, 15, 131072, 0, 65551, 131072, 1, 131087, 131072, 1, 196623, 131072, 1, 262159, 131072, 1, 327695, 131072, 1, 393231, 131072, 1, 589839, 131072, 1, 655375, 131072, 1, 720911, 131072, 1, 786447, 131072, 1, 851983, 131072, 1, 917519, 131072, 1, 983055, 131072, 2, 65536, 0, 1, 0, 0, 0, 1, 65536, 0, 458758, 0, 1, 393223, 65536, 1, 458759, 65536, 1, 327686, 65536, 1, 262149, 65536, 1, 196612, 65536, 1, 131075, 65536, 1, 65538, 65536, 1, 786446, 65536, 1, 720909, 65536, 1, 655372, 65536, 1, 589835, 65536, 1, 524298, 65536, 1, 196611, 393216, 1, 262148, 393216, 1, 327685, 393216, 1, 589834, 393216, 1, 655371, 393216, 1, 720908, 393216, 1, 786445, 393216, 1, 851982, 393216, 1, 131074, 393216, 1, 65537, 65536, 1, 196610, 0, 2, 262147, 0, 2, 327684, 0, 2, 393221, 0, 2, 655370, 0, 2, 720907, 0, 2, 786444, 0, 2, 851981, 0, 2, 917518, 0, 1, 131073, 65536, 2, 7, 65536, 0, 8, 65536, 0, 458767, 131072, 1, 524303, 131072, 1, 720910, 65536, 1, 655374, 65536, 1, 589838, 65536, 1, 524302, 65536, 1, 458766, 65536, 1, 393230, 65536, 1, 327694, 65536, 1, 262158, 65536, 1, 196622, 65536, 1, 131086, 65536, 1, 65550, 65536, 1, 655373, 65536, 1, 589837, 65536, 1, 524301, 65536, 1, 458765, 65536, 1, 393229, 65536, 1, 327693, 65536, 1, 262157, 65536, 1, 196621, 65536, 1, 131085, 65536, 1, 65549, 65536, 1, 589836, 65536, 1, 524300, 65536, 1, 458764, 65536, 1, 393228, 65536, 1, 327692, 65536, 1, 262156, 65536, 1, 196620, 65536, 1, 131084, 65536, 1, 65548, 65536, 1, 524299, 65536, 1, 458763, 65536, 1, 393227, 65536, 1, 327691, 65536, 1, 262155, 65536, 1, 196619, 65536, 1, 131083, 65536, 1, 65547, 65536, 1, 458762, 65536, 1, 393226, 65536, 1, 327690, 65536, 1, 262154, 65536, 1, 196618, 65536, 1, 131082, 65536, 1, 65546, 65536, 1, 327689, 65536, 1, 262153, 65536, 1, 196617, 65536, 1, 131081, 65536, 1, 65545, 65536, 1, 327688, 65536, 1, 262152, 65536, 1, 196616, 65536, 1, 131080, 65536, 1, 65544, 65536, 1, 327687, 65536, 1, 262151, 65536, 1, 196615, 65536, 1, 131079, 65536, 1, 65543, 65536, 1, 262150, 65536, 1, 196614, 65536, 1, 131078, 65536, 1, 65542, 65536, 1, 196613, 65536, 1, 131077, 65536, 1, 65541, 65536, 1, 131076, 65536, 1, 65540, 65536, 1, 65539, 65536, 1)
diff --git a/levels/rand/07.tscn b/levels/rand/07.tscn
index a6fc775..473f1e9 100644
--- a/levels/rand/07.tscn
+++ b/levels/rand/07.tscn
@@ -1,6 +1,6 @@
-[gd_scene load_steps=2 format=3]
+[gd_scene load_steps=2 format=3 uid="uid://dsjel2dj0wjo2"]
-[ext_resource type="PackedScene" uid="uid://h2yl2s2kudv8" path="res://levels/Level.tscn" id="1_3bnrf"]
+[ext_resource type="PackedScene" uid="uid://dxx21fiom4ef1" path="res://levels/Level.tscn" id="1_3bnrf"]
[node name="07" instance=ExtResource("1_3bnrf")]
layer_0/tile_data = PackedInt32Array(131072, 196608, 1, 196608, 196608, 1, 262144, 196608, 1, 327680, 196608, 1, 393216, 196608, 2, 589824, 196608, 0, 655360, 196608, 1, 720896, 196608, 1, 786432, 196608, 1, 851968, 196608, 1, 917504, 196608, 1, 983040, 262144, 3, 983041, 65536, 3, 2, 65536, 3, 983042, 65536, 3, 3, 65536, 3, 983043, 65536, 3, 4, 65536, 3, 983044, 65536, 3, 5, 65536, 3, 983045, 65536, 3, 6, 131072, 3, 393222, 0, 0, 524294, 0, 1, 589830, 0, 2, 983046, 65536, 3, 524295, 65536, 1, 589831, 65536, 2, 393224, 65536, 0, 458760, 65536, 1, 524296, 65536, 1, 589832, 65536, 2, 9, 0, 3, 393225, 131072, 0, 458761, 131072, 1, 524297, 131072, 1, 589833, 131072, 2, 983049, 65536, 3, 10, 65536, 3, 983050, 65536, 3, 11, 65536, 3, 983051, 65536, 3, 12, 65536, 3, 983052, 65536, 3, 13, 65536, 3, 983053, 65536, 3, 14, 65536, 3, 983054, 65536, 3, 15, 458752, 0, 65551, 196608, 1, 131087, 196608, 1, 196623, 196608, 1, 262159, 196608, 1, 327695, 196608, 1, 393231, 196608, 2, 589839, 196608, 0, 655375, 196608, 1, 720911, 196608, 1, 786447, 196608, 1, 851983, 196608, 1, 917519, 196608, 1, 983055, 458752, 3, 65536, 196608, 1, 0, 262144, 0, 1, 65536, 3, 458758, 0, 1, 393223, 65536, 0, 458759, 65536, 1, 983047, 65536, 3, 983048, 65536, 3)
diff --git a/levels/rand/08.tscn b/levels/rand/08.tscn
index 4950d60..c95f7ff 100644
--- a/levels/rand/08.tscn
+++ b/levels/rand/08.tscn
@@ -1,6 +1,6 @@
-[gd_scene load_steps=2 format=3]
+[gd_scene load_steps=2 format=3 uid="uid://s1lsinwfques"]
-[ext_resource type="PackedScene" uid="uid://h2yl2s2kudv8" path="res://levels/Level.tscn" id="1_4ldoi"]
+[ext_resource type="PackedScene" uid="uid://dxx21fiom4ef1" path="res://levels/Level.tscn" id="1_4ldoi"]
[node name="08" instance=ExtResource("1_4ldoi")]
layer_0/tile_data = PackedInt32Array(131072, 0, 1, 196608, 0, 1, 262144, 0, 1, 327680, 0, 1, 393216, 0, 2, 589824, 0, 0, 655360, 0, 1, 720896, 0, 1, 786432, 0, 1, 851968, 0, 1, 917504, 0, 1, 983040, 0, 2, 983041, 65536, 2, 2, 65536, 0, 983042, 65536, 2, 3, 65536, 0, 983043, 65536, 2, 4, 65536, 0, 983044, 65536, 2, 5, 65536, 0, 983045, 65536, 2, 6, 65536, 0, 524294, 0, 2, 983046, 65536, 2, 524295, 65536, 2, 458760, 65536, 0, 524296, 65536, 2, 9, 65536, 0, 458761, 131072, 0, 524297, 131072, 2, 983049, 65536, 2, 10, 65536, 0, 983050, 65536, 2, 11, 65536, 0, 983051, 65536, 2, 12, 65536, 0, 983052, 65536, 2, 13, 65536, 0, 983053, 65536, 2, 14, 65536, 0, 983054, 65536, 2, 15, 131072, 0, 65551, 131072, 1, 131087, 131072, 1, 196623, 131072, 1, 262159, 131072, 1, 327695, 131072, 1, 393231, 131072, 2, 589839, 131072, 0, 655375, 131072, 1, 720911, 131072, 1, 786447, 131072, 1, 851983, 131072, 1, 917519, 131072, 1, 983055, 131072, 2, 65536, 0, 1, 0, 0, 0, 1, 65536, 0, 458758, 0, 0, 458759, 65536, 0, 7, 65536, 0, 8, 65536, 0, 983047, 65536, 2, 983048, 65536, 2, 917518, 65536, 1, 851982, 65536, 1, 786446, 65536, 1, 720910, 65536, 1, 655374, 65536, 1, 589838, 65536, 0, 917517, 65536, 1, 851981, 65536, 1, 786445, 65536, 1, 720909, 65536, 1, 655373, 65536, 1, 589837, 65536, 0, 917516, 65536, 1, 851980, 65536, 1, 786444, 65536, 1, 720908, 65536, 1, 655372, 65536, 1, 589836, 65536, 0, 917515, 65536, 1, 851979, 65536, 1, 786443, 65536, 1, 720907, 393216, 2, 655371, 0, 1, 589835, 0, 0, 917514, 65536, 1, 851978, 65536, 1, 786442, 65536, 1, 720906, 65536, 0, 917513, 65536, 1, 851977, 65536, 1, 786441, 65536, 1, 720905, 65536, 0, 917512, 65536, 1, 851976, 65536, 1, 786440, 65536, 1, 720904, 65536, 0, 917511, 65536, 1, 851975, 65536, 1, 786439, 65536, 1, 720903, 65536, 0, 917510, 65536, 1, 851974, 65536, 1, 786438, 65536, 1, 720902, 65536, 0, 917509, 65536, 1, 851973, 65536, 1, 786437, 65536, 1, 720901, 65536, 0, 917508, 65536, 1, 851972, 65536, 1, 786436, 65536, 1, 720900, 327680, 2, 655364, 131072, 1, 589828, 131072, 0, 917507, 65536, 1, 851971, 65536, 1, 786435, 65536, 1, 720899, 65536, 1, 655363, 65536, 1, 589827, 65536, 0, 917506, 65536, 1, 851970, 65536, 1, 786434, 65536, 1, 720898, 65536, 1, 655362, 65536, 1, 589826, 65536, 0, 917505, 65536, 1, 851969, 65536, 1, 786433, 65536, 1, 720897, 65536, 1, 655361, 65536, 1, 589825, 65536, 0, 393230, 65536, 2, 327694, 65536, 1, 262158, 65536, 1, 196622, 65536, 1, 131086, 65536, 1, 65550, 65536, 1, 393229, 65536, 2, 327693, 65536, 1, 262157, 65536, 1, 196621, 65536, 1, 131085, 65536, 1, 65549, 65536, 1, 393228, 65536, 2, 327692, 65536, 1, 262156, 65536, 1, 196620, 65536, 1, 131084, 65536, 1, 65548, 65536, 1, 393227, 0, 2, 327691, 393216, 1, 262155, 65536, 1, 196619, 65536, 1, 131083, 65536, 1, 65547, 65536, 1, 327690, 65536, 2, 262154, 65536, 1, 196618, 65536, 1, 131082, 65536, 1, 65546, 65536, 1, 327689, 65536, 2, 262153, 65536, 1, 196617, 65536, 1, 131081, 65536, 1, 65545, 65536, 1, 327688, 65536, 2, 262152, 65536, 1, 196616, 65536, 1, 131080, 65536, 1, 65544, 65536, 1, 327687, 65536, 2, 262151, 65536, 1, 196615, 65536, 1, 131079, 65536, 1, 65543, 65536, 1, 327686, 65536, 2, 262150, 65536, 1, 196614, 65536, 1, 131078, 65536, 1, 65542, 65536, 1, 262149, 65536, 1, 196613, 65536, 1, 131077, 65536, 1, 65541, 65536, 1, 393220, 131072, 2, 327684, 327680, 1, 262148, 65536, 1, 196612, 65536, 1, 131076, 65536, 1, 65540, 65536, 1, 393219, 65536, 2, 327683, 65536, 1, 262147, 65536, 1, 196611, 65536, 1, 131075, 65536, 1, 65539, 65536, 1, 393218, 65536, 2, 327682, 65536, 1, 262146, 65536, 1, 196610, 65536, 1, 131074, 65536, 1, 65538, 65536, 1, 393217, 65536, 2, 327681, 65536, 1, 262145, 65536, 1, 196609, 65536, 1, 131073, 65536, 1, 65537, 65536, 1, 327685, 65536, 2)
diff --git a/levels/rand/09.tscn b/levels/rand/09.tscn
index 5f25fdc..db876ee 100644
--- a/levels/rand/09.tscn
+++ b/levels/rand/09.tscn
@@ -1,6 +1,6 @@
-[gd_scene load_steps=2 format=3]
+[gd_scene load_steps=2 format=3 uid="uid://e4kinwyx5821"]
-[ext_resource type="PackedScene" uid="uid://h2yl2s2kudv8" path="res://levels/Level.tscn" id="1_ix63m"]
+[ext_resource type="PackedScene" uid="uid://dxx21fiom4ef1" path="res://levels/Level.tscn" id="1_ix63m"]
[node name="09" instance=ExtResource("1_ix63m")]
layer_0/tile_data = PackedInt32Array(131072, 196608, 1, 196608, 196608, 1, 262144, 196608, 1, 327680, 196608, 1, 393216, 196608, 2, 589824, 196608, 0, 655360, 196608, 1, 720896, 196608, 1, 786432, 196608, 1, 851968, 196608, 1, 917504, 196608, 1, 983040, 262144, 3, 983041, 65536, 3, 2, 65536, 3, 983042, 65536, 3, 3, 65536, 3, 983043, 65536, 3, 4, 65536, 3, 983044, 65536, 3, 5, 65536, 3, 983045, 65536, 3, 6, 131072, 3, 393222, 0, 0, 524294, 0, 1, 589830, 0, 2, 983046, 65536, 3, 524295, 65536, 1, 589831, 65536, 2, 393224, 65536, 0, 458760, 65536, 1, 524296, 65536, 1, 589832, 65536, 2, 9, 0, 3, 393225, 131072, 0, 458761, 131072, 1, 524297, 131072, 1, 589833, 131072, 2, 983049, 65536, 3, 10, 65536, 3, 983050, 393216, 3, 11, 65536, 3, 983051, 65536, 2, 12, 65536, 3, 983052, 65536, 2, 13, 65536, 3, 983053, 65536, 2, 14, 65536, 3, 983054, 65536, 2, 15, 458752, 0, 65551, 196608, 1, 131087, 196608, 1, 196623, 196608, 1, 262159, 196608, 1, 327695, 196608, 1, 393231, 196608, 1, 589839, 131072, 1, 655375, 131072, 1, 720911, 131072, 1, 786447, 131072, 1, 851983, 131072, 1, 917519, 131072, 1, 983055, 131072, 2, 65536, 196608, 1, 0, 262144, 0, 1, 65536, 3, 458758, 0, 1, 393223, 65536, 0, 458759, 65536, 1, 983047, 65536, 3, 983048, 65536, 3, 917514, 0, 0, 917515, 65536, 0, 917516, 393216, 2, 851981, 65536, 1, 851982, 65536, 1, 786446, 65536, 1, 720910, 393216, 2, 524303, 458752, 2, 458767, 196608, 1, 524302, 0, 0, 589838, 0, 1, 655374, 0, 1, 917517, 65536, 1, 917518, 65536, 1, 786445, 393216, 2, 720909, 0, 0, 786444, 0, 0, 851980, 0, 1)
diff --git a/levels/rand/10.tscn b/levels/rand/10.tscn
index 3d21abc..94ee4cc 100644
--- a/levels/rand/10.tscn
+++ b/levels/rand/10.tscn
@@ -1,6 +1,6 @@
-[gd_scene load_steps=2 format=3]
+[gd_scene load_steps=2 format=3 uid="uid://dd74d1a4uirhr"]
-[ext_resource type="PackedScene" uid="uid://h2yl2s2kudv8" path="res://levels/Level.tscn" id="1_c2n3v"]
+[ext_resource type="PackedScene" uid="uid://dxx21fiom4ef1" path="res://levels/Level.tscn" id="1_c2n3v"]
[node name="10" instance=ExtResource("1_c2n3v")]
layer_0/tile_data = PackedInt32Array(131072, 196608, 1, 196608, 196608, 1, 262144, 196608, 1, 327680, 196608, 1, 393216, 196608, 2, 589824, 196608, 0, 655360, 196608, 1, 720896, 196608, 1, 786432, 196608, 1, 851968, 196608, 1, 917504, 196608, 1, 983040, 262144, 3, 983041, 65536, 3, 2, 65536, 3, 983042, 65536, 3, 3, 65536, 3, 983043, 65536, 3, 4, 65536, 3, 983044, 65536, 3, 5, 65536, 3, 983045, 65536, 3, 6, 65536, 3, 393222, 0, 0, 524294, 0, 1, 589830, 0, 2, 983046, 65536, 3, 524295, 65536, 1, 589831, 65536, 2, 393224, 65536, 0, 458760, 65536, 1, 524296, 65536, 1, 589832, 65536, 2, 9, 65536, 3, 393225, 131072, 0, 458761, 131072, 1, 524297, 131072, 1, 589833, 131072, 2, 983049, 65536, 3, 10, 65536, 3, 983050, 65536, 3, 11, 65536, 3, 983051, 65536, 3, 12, 65536, 3, 983052, 65536, 3, 13, 65536, 3, 983053, 65536, 3, 14, 65536, 3, 983054, 65536, 3, 15, 458752, 0, 65551, 196608, 1, 131087, 196608, 1, 196623, 196608, 1, 262159, 196608, 1, 327695, 196608, 1, 393231, 196608, 1, 589839, 196608, 1, 655375, 196608, 1, 720911, 196608, 1, 786447, 196608, 1, 851983, 196608, 1, 917519, 196608, 1, 983055, 458752, 3, 65536, 196608, 1, 0, 262144, 0, 1, 65536, 3, 458758, 0, 1, 393223, 65536, 0, 458759, 65536, 1, 983047, 65536, 3, 983048, 65536, 3, 524303, 196608, 1, 458767, 196608, 1, 8, 65536, 3, 7, 65536, 3)
diff --git a/levels/rand/11.tscn b/levels/rand/11.tscn
index b6719ef..883363c 100644
--- a/levels/rand/11.tscn
+++ b/levels/rand/11.tscn
@@ -1,6 +1,6 @@
-[gd_scene load_steps=2 format=3]
+[gd_scene load_steps=2 format=3 uid="uid://dip1l1cd8s8p0"]
-[ext_resource type="PackedScene" uid="uid://h2yl2s2kudv8" path="res://levels/Level.tscn" id="1_pa3ds"]
+[ext_resource type="PackedScene" uid="uid://dxx21fiom4ef1" path="res://levels/Level.tscn" id="1_pa3ds"]
[node name="11" instance=ExtResource("1_pa3ds")]
layer_0/tile_data = PackedInt32Array(131072, 196608, 1, 196608, 196608, 1, 262144, 196608, 1, 327680, 196608, 1, 393216, 196608, 1, 589824, 196608, 1, 655360, 196608, 1, 720896, 196608, 1, 786432, 196608, 1, 851968, 196608, 1, 917504, 196608, 1, 983040, 262144, 3, 983041, 65536, 3, 2, 65536, 3, 983042, 65536, 3, 3, 65536, 3, 983043, 65536, 3, 4, 65536, 3, 983044, 65536, 3, 5, 65536, 3, 983045, 65536, 3, 6, 131072, 3, 393222, 0, 0, 524294, 0, 1, 589830, 0, 2, 983046, 131072, 3, 524295, 65536, 1, 589831, 65536, 2, 393224, 65536, 0, 458760, 65536, 1, 524296, 65536, 1, 589832, 65536, 2, 9, 0, 3, 393225, 131072, 0, 458761, 131072, 1, 524297, 131072, 1, 589833, 131072, 2, 983049, 0, 3, 10, 65536, 3, 983050, 65536, 3, 11, 65536, 3, 983051, 65536, 3, 12, 65536, 3, 983052, 65536, 3, 13, 65536, 3, 983053, 65536, 3, 14, 65536, 3, 983054, 65536, 3, 15, 458752, 0, 65551, 196608, 1, 131087, 196608, 1, 196623, 196608, 1, 262159, 196608, 1, 327695, 196608, 1, 393231, 196608, 2, 589839, 196608, 0, 655375, 196608, 1, 720911, 196608, 1, 786447, 196608, 1, 851983, 196608, 1, 917519, 196608, 1, 983055, 458752, 3, 65536, 196608, 1, 0, 262144, 0, 1, 65536, 3, 458758, 0, 1, 393223, 65536, 0, 458759, 65536, 1, 524288, 196608, 1, 458752, 196608, 1)
diff --git a/levels/rand/12.tscn b/levels/rand/12.tscn
index 957bf93..0fadbab 100644
--- a/levels/rand/12.tscn
+++ b/levels/rand/12.tscn
@@ -1,6 +1,6 @@
-[gd_scene load_steps=2 format=3]
+[gd_scene load_steps=2 format=3 uid="uid://bfpc41oqcf0qw"]
-[ext_resource type="PackedScene" uid="uid://h2yl2s2kudv8" path="res://levels/Level.tscn" id="1_x55go"]
+[ext_resource type="PackedScene" uid="uid://dxx21fiom4ef1" path="res://levels/Level.tscn" id="1_x55go"]
[node name="12" instance=ExtResource("1_x55go")]
layer_0/tile_data = PackedInt32Array(131072, 196608, 1, 196608, 196608, 1, 262144, 196608, 1, 327680, 196608, 1, 393216, 196608, 1, 589824, 196608, 1, 655360, 196608, 1, 720896, 196608, 1, 786432, 196608, 1, 851968, 196608, 1, 917504, 196608, 1, 983040, 262144, 3, 983041, 65536, 3, 2, 65536, 3, 983042, 65536, 3, 3, 65536, 3, 983043, 65536, 3, 4, 65536, 3, 983044, 65536, 3, 5, 65536, 3, 983045, 65536, 3, 6, 65536, 3, 393222, 0, 0, 524294, 0, 1, 589830, 0, 2, 983046, 131072, 3, 524295, 65536, 1, 589831, 65536, 2, 393224, 65536, 0, 458760, 65536, 1, 524296, 65536, 1, 589832, 65536, 2, 9, 65536, 3, 393225, 131072, 0, 458761, 131072, 1, 524297, 131072, 1, 589833, 131072, 2, 983049, 0, 3, 10, 65536, 3, 983050, 65536, 3, 11, 65536, 3, 983051, 65536, 3, 12, 65536, 3, 983052, 65536, 3, 13, 65536, 3, 983053, 65536, 3, 14, 65536, 3, 983054, 65536, 3, 15, 458752, 0, 65551, 196608, 1, 131087, 196608, 1, 196623, 196608, 1, 262159, 196608, 1, 327695, 196608, 1, 393231, 196608, 2, 589839, 196608, 0, 655375, 196608, 1, 720911, 196608, 1, 786447, 196608, 1, 851983, 196608, 1, 917519, 196608, 1, 983055, 458752, 3, 65536, 196608, 1, 0, 262144, 0, 1, 65536, 3, 458758, 0, 1, 393223, 65536, 0, 458759, 65536, 1, 7, 65536, 3, 8, 65536, 3, 458752, 196608, 1, 524288, 196608, 1)
diff --git a/levels/rand/13.tscn b/levels/rand/13.tscn
index 437bfff..cb6013a 100644
--- a/levels/rand/13.tscn
+++ b/levels/rand/13.tscn
@@ -1,6 +1,6 @@
-[gd_scene load_steps=2 format=3]
+[gd_scene load_steps=2 format=3 uid="uid://ml0vpr107gc8"]
-[ext_resource type="PackedScene" uid="uid://h2yl2s2kudv8" path="res://levels/Level.tscn" id="1_13npg"]
+[ext_resource type="PackedScene" uid="uid://dxx21fiom4ef1" path="res://levels/Level.tscn" id="1_13npg"]
[node name="13" instance=ExtResource("1_13npg")]
layer_0/tile_data = PackedInt32Array(131072, 196608, 1, 196608, 196608, 1, 262144, 196608, 1, 327680, 196608, 1, 393216, 196608, 1, 589824, 196608, 1, 655360, 196608, 1, 720896, 196608, 1, 786432, 196608, 1, 851968, 196608, 1, 917504, 196608, 1, 983040, 262144, 3, 983041, 65536, 3, 2, 65536, 3, 983042, 65536, 3, 3, 65536, 3, 983043, 65536, 3, 4, 65536, 3, 983044, 65536, 3, 5, 65536, 3, 983045, 65536, 3, 6, 131072, 3, 393222, 0, 0, 524294, 0, 1, 589830, 0, 2, 983046, 131072, 3, 524295, 65536, 1, 589831, 65536, 2, 393224, 65536, 0, 458760, 65536, 1, 524296, 65536, 1, 589832, 65536, 2, 9, 0, 3, 393225, 131072, 0, 458761, 131072, 1, 524297, 131072, 1, 589833, 131072, 2, 983049, 0, 3, 10, 65536, 3, 983050, 65536, 3, 11, 65536, 3, 983051, 65536, 3, 12, 65536, 3, 983052, 65536, 3, 13, 65536, 3, 983053, 65536, 3, 14, 65536, 3, 983054, 65536, 3, 15, 458752, 0, 65551, 196608, 1, 131087, 196608, 1, 196623, 196608, 1, 262159, 196608, 1, 327695, 196608, 1, 393231, 196608, 1, 589839, 196608, 1, 655375, 196608, 1, 720911, 196608, 1, 786447, 196608, 1, 851983, 196608, 1, 917519, 196608, 1, 983055, 458752, 3, 65536, 196608, 1, 0, 262144, 0, 1, 65536, 3, 458758, 0, 1, 393223, 65536, 0, 458759, 65536, 1, 458767, 196608, 1, 524303, 196608, 1, 458752, 196608, 1, 524288, 196608, 1)
diff --git a/levels/rand/14.tscn b/levels/rand/14.tscn
index 9ac75c0..a0f561e 100644
--- a/levels/rand/14.tscn
+++ b/levels/rand/14.tscn
@@ -1,6 +1,6 @@
-[gd_scene load_steps=2 format=3]
+[gd_scene load_steps=2 format=3 uid="uid://cpg5dac48jhj0"]
-[ext_resource type="PackedScene" uid="uid://h2yl2s2kudv8" path="res://levels/Level.tscn" id="1_d7058"]
+[ext_resource type="PackedScene" uid="uid://dxx21fiom4ef1" path="res://levels/Level.tscn" id="1_d7058"]
[node name="14" instance=ExtResource("1_d7058")]
layer_0/tile_data = PackedInt32Array(131072, 196608, 1, 196608, 196608, 1, 262144, 196608, 1, 327680, 196608, 1, 393216, 196608, 1, 589824, 196608, 1, 655360, 196608, 1, 720896, 196608, 1, 786432, 196608, 1, 851968, 196608, 1, 917504, 196608, 1, 983040, 262144, 3, 983041, 65536, 3, 2, 65536, 3, 983042, 65536, 3, 3, 65536, 3, 983043, 65536, 3, 4, 65536, 3, 983044, 65536, 3, 5, 65536, 3, 983045, 65536, 3, 6, 65536, 3, 393222, 0, 0, 524294, 0, 1, 589830, 0, 2, 983046, 131072, 3, 524295, 65536, 1, 589831, 65536, 2, 393224, 65536, 0, 458760, 65536, 1, 524296, 65536, 1, 589832, 65536, 2, 9, 65536, 3, 393225, 131072, 0, 458761, 131072, 1, 524297, 131072, 1, 589833, 131072, 2, 983049, 0, 3, 10, 65536, 3, 983050, 65536, 3, 11, 65536, 3, 983051, 65536, 3, 12, 65536, 3, 983052, 65536, 3, 13, 65536, 3, 983053, 65536, 3, 14, 65536, 3, 983054, 65536, 3, 15, 458752, 0, 65551, 196608, 1, 131087, 196608, 1, 196623, 196608, 1, 262159, 196608, 1, 327695, 196608, 1, 393231, 196608, 1, 589839, 196608, 1, 655375, 196608, 1, 720911, 196608, 1, 786447, 196608, 1, 851983, 196608, 1, 917519, 196608, 1, 983055, 458752, 3, 65536, 196608, 1, 0, 262144, 0, 1, 65536, 3, 458758, 0, 1, 393223, 65536, 0, 458759, 65536, 1, 458752, 196608, 1, 524288, 196608, 1, 8, 65536, 3, 7, 65536, 3, 524303, 196608, 1, 458767, 196608, 1)
diff --git a/levels/rand/15.tscn b/levels/rand/15.tscn
index cfd2837..d12ce0f 100644
--- a/levels/rand/15.tscn
+++ b/levels/rand/15.tscn
@@ -1,6 +1,6 @@
-[gd_scene load_steps=2 format=3]
+[gd_scene load_steps=2 format=3 uid="uid://bk6x0rwnfcnax"]
-[ext_resource type="PackedScene" uid="uid://h2yl2s2kudv8" path="res://levels/Level.tscn" id="1_40br1"]
+[ext_resource type="PackedScene" uid="uid://dxx21fiom4ef1" path="res://levels/Level.tscn" id="1_40br1"]
[node name="15" instance=ExtResource("1_40br1")]
layer_0/tile_data = PackedInt32Array(131072, 196608, 1, 196608, 196608, 1, 262144, 196608, 1, 327680, 196608, 1, 393216, 196608, 1, 589824, 196608, 1, 655360, 196608, 1, 720896, 196608, 1, 786432, 196608, 1, 851968, 196608, 1, 917504, 196608, 1, 983040, 262144, 3, 983041, 65536, 3, 2, 65536, 3, 983042, 65536, 3, 3, 65536, 3, 983043, 65536, 3, 4, 65536, 3, 983044, 65536, 3, 5, 65536, 3, 983045, 65536, 3, 6, 131072, 3, 393222, 0, 0, 524294, 0, 1, 589830, 0, 2, 983046, 65536, 3, 524295, 65536, 1, 589831, 65536, 2, 393224, 65536, 0, 458760, 65536, 1, 524296, 65536, 1, 589832, 65536, 2, 9, 0, 3, 393225, 131072, 0, 458761, 131072, 1, 524297, 131072, 1, 589833, 131072, 2, 983049, 65536, 3, 10, 65536, 3, 983050, 65536, 3, 11, 65536, 3, 983051, 65536, 3, 12, 65536, 3, 983052, 65536, 3, 13, 65536, 3, 983053, 65536, 3, 14, 65536, 3, 983054, 65536, 3, 15, 458752, 0, 65551, 196608, 1, 131087, 196608, 1, 196623, 196608, 1, 262159, 196608, 1, 327695, 196608, 1, 393231, 196608, 2, 589839, 196608, 0, 655375, 196608, 1, 720911, 196608, 1, 786447, 196608, 1, 851983, 196608, 1, 917519, 196608, 1, 983055, 458752, 3, 65536, 196608, 1, 0, 262144, 0, 1, 65536, 3, 458758, 0, 1, 393223, 65536, 0, 458759, 65536, 1, 458752, 196608, 1, 524288, 196608, 1, 983047, 65536, 3, 983048, 65536, 3)
diff --git a/levels/rand/16.tscn b/levels/rand/16.tscn
index af4ec04..762c4fa 100644
--- a/levels/rand/16.tscn
+++ b/levels/rand/16.tscn
@@ -1,6 +1,6 @@
-[gd_scene load_steps=2 format=3]
+[gd_scene load_steps=2 format=3 uid="uid://dcbnac3k5c2bh"]
-[ext_resource type="PackedScene" uid="uid://h2yl2s2kudv8" path="res://levels/Level.tscn" id="1_yds8y"]
+[ext_resource type="PackedScene" uid="uid://dxx21fiom4ef1" path="res://levels/Level.tscn" id="1_yds8y"]
[node name="16" instance=ExtResource("1_yds8y")]
layer_0/tile_data = PackedInt32Array(131072, 196608, 1, 196608, 196608, 1, 262144, 196608, 1, 327680, 196608, 1, 393216, 196608, 1, 589824, 196608, 1, 655360, 196608, 1, 720896, 196608, 1, 786432, 196608, 1, 851968, 196608, 1, 917504, 196608, 1, 983040, 262144, 3, 983041, 65536, 3, 2, 65536, 3, 983042, 65536, 3, 3, 65536, 3, 983043, 65536, 3, 4, 65536, 3, 983044, 65536, 3, 5, 65536, 3, 983045, 65536, 3, 6, 65536, 3, 393222, 0, 0, 524294, 0, 1, 589830, 0, 2, 983046, 65536, 3, 524295, 65536, 1, 589831, 65536, 2, 393224, 65536, 0, 458760, 65536, 1, 524296, 65536, 1, 589832, 65536, 2, 9, 65536, 3, 393225, 131072, 0, 458761, 131072, 1, 524297, 131072, 1, 589833, 131072, 2, 983049, 65536, 3, 10, 65536, 3, 983050, 65536, 3, 11, 65536, 3, 983051, 65536, 3, 12, 65536, 3, 983052, 65536, 3, 13, 65536, 3, 983053, 65536, 3, 14, 65536, 3, 983054, 65536, 3, 15, 458752, 0, 65551, 196608, 1, 131087, 196608, 1, 196623, 196608, 1, 262159, 196608, 1, 327695, 196608, 1, 393231, 196608, 2, 589839, 196608, 0, 655375, 196608, 1, 720911, 196608, 1, 786447, 196608, 1, 851983, 196608, 1, 917519, 196608, 1, 983055, 458752, 3, 65536, 196608, 1, 0, 262144, 0, 1, 65536, 3, 458758, 0, 1, 393223, 65536, 0, 458759, 65536, 1, 983048, 65536, 3, 983047, 65536, 3, 524288, 196608, 1, 458752, 196608, 1, 7, 65536, 3, 8, 65536, 3)
diff --git a/levels/rand/17.tscn b/levels/rand/17.tscn
index 66307d2..b2a7888 100644
--- a/levels/rand/17.tscn
+++ b/levels/rand/17.tscn
@@ -1,6 +1,6 @@
-[gd_scene load_steps=2 format=3]
+[gd_scene load_steps=2 format=3 uid="uid://pk206siyyege"]
-[ext_resource type="PackedScene" uid="uid://h2yl2s2kudv8" path="res://levels/Level.tscn" id="1_otvl3"]
+[ext_resource type="PackedScene" uid="uid://dxx21fiom4ef1" path="res://levels/Level.tscn" id="1_otvl3"]
[node name="17" instance=ExtResource("1_otvl3")]
layer_0/tile_data = PackedInt32Array(131072, 196608, 1, 196608, 196608, 1, 262144, 196608, 1, 327680, 196608, 1, 393216, 196608, 1, 589824, 196608, 1, 655360, 196608, 1, 720896, 196608, 1, 786432, 262144, 2, 851968, 0, 1, 917504, 0, 1, 983040, 0, 2, 983041, 65536, 2, 2, 65536, 3, 983042, 327680, 3, 3, 65536, 3, 983043, 65536, 3, 4, 65536, 3, 983044, 65536, 3, 5, 65536, 3, 983045, 65536, 3, 6, 131072, 3, 393222, 0, 0, 524294, 0, 1, 589830, 0, 2, 983046, 65536, 3, 524295, 65536, 1, 589831, 65536, 2, 393224, 65536, 0, 458760, 65536, 1, 524296, 65536, 1, 589832, 65536, 2, 9, 0, 3, 393225, 131072, 0, 458761, 131072, 1, 524297, 131072, 1, 589833, 131072, 2, 983049, 65536, 3, 10, 65536, 3, 983050, 65536, 3, 11, 65536, 3, 983051, 65536, 3, 12, 65536, 3, 983052, 65536, 3, 13, 65536, 3, 983053, 65536, 3, 14, 65536, 3, 983054, 65536, 3, 15, 458752, 0, 65551, 196608, 1, 131087, 196608, 1, 196623, 196608, 1, 262159, 196608, 1, 327695, 196608, 1, 393231, 196608, 1, 589839, 196608, 1, 655375, 196608, 1, 720911, 196608, 1, 786447, 196608, 1, 851983, 196608, 1, 917519, 196608, 1, 983055, 458752, 3, 65536, 196608, 1, 0, 262144, 0, 1, 65536, 3, 458758, 0, 1, 393223, 65536, 0, 458759, 65536, 1, 458752, 196608, 1, 524288, 196608, 1, 786433, 131072, 0, 917505, 327680, 2, 851969, 131072, 1, 917506, 131072, 0, 983047, 65536, 3, 983048, 65536, 3, 524303, 196608, 1, 458767, 196608, 1)
diff --git a/levels/rand/18.tscn b/levels/rand/18.tscn
index fcaa73a..d6a73c0 100644
--- a/levels/rand/18.tscn
+++ b/levels/rand/18.tscn
@@ -1,6 +1,6 @@
-[gd_scene load_steps=2 format=3]
+[gd_scene load_steps=2 format=3 uid="uid://dbcrx23xsfrlp"]
-[ext_resource type="PackedScene" uid="uid://h2yl2s2kudv8" path="res://levels/Level.tscn" id="1_ucpni"]
+[ext_resource type="PackedScene" uid="uid://dxx21fiom4ef1" path="res://levels/Level.tscn" id="1_ucpni"]
[node name="18" instance=ExtResource("1_ucpni")]
layer_0/tile_data = PackedInt32Array(131072, 0, 1, 196608, 0, 1, 262144, 0, 1, 327680, 0, 1, 393216, 0, 1, 589824, 0, 1, 655360, 0, 1, 720896, 0, 1, 786432, 0, 1, 851968, 0, 1, 917504, 0, 1, 983040, 0, 2, 983041, 65536, 2, 2, 65536, 0, 983042, 65536, 2, 3, 65536, 0, 983043, 65536, 2, 4, 65536, 0, 983044, 65536, 2, 5, 65536, 0, 983045, 65536, 2, 6, 65536, 0, 393222, 65536, 1, 524294, 65536, 1, 589830, 65536, 1, 983046, 65536, 2, 524295, 65536, 1, 589831, 65536, 1, 393224, 65536, 1, 458760, 65536, 1, 524296, 65536, 1, 589832, 65536, 1, 9, 65536, 0, 393225, 65536, 1, 458761, 65536, 1, 524297, 65536, 1, 589833, 65536, 1, 983049, 65536, 2, 10, 65536, 0, 983050, 65536, 2, 11, 65536, 0, 983051, 65536, 2, 12, 65536, 0, 983052, 65536, 2, 13, 65536, 0, 983053, 65536, 2, 14, 65536, 0, 983054, 65536, 2, 15, 131072, 0, 65551, 131072, 1, 131087, 131072, 1, 196623, 131072, 1, 262159, 131072, 1, 327695, 131072, 1, 393231, 131072, 1, 589839, 131072, 1, 655375, 131072, 1, 720911, 131072, 1, 786447, 131072, 1, 851983, 131072, 1, 917519, 131072, 1, 983055, 131072, 2, 65536, 0, 1, 0, 0, 0, 1, 65536, 0, 458758, 65536, 1, 393223, 65536, 1, 458759, 65536, 1, 524303, 131072, 1, 458767, 131072, 1, 917518, 65536, 1, 851982, 65536, 1, 786446, 65536, 1, 720910, 65536, 1, 655374, 65536, 1, 589838, 65536, 1, 524302, 65536, 1, 458766, 65536, 1, 393230, 65536, 1, 327694, 65536, 1, 262158, 65536, 1, 196622, 65536, 1, 131086, 65536, 1, 65550, 65536, 1, 917517, 65536, 1, 851981, 65536, 1, 786445, 65536, 1, 720909, 65536, 1, 655373, 65536, 1, 589837, 65536, 1, 524301, 65536, 1, 458765, 65536, 1, 393229, 65536, 1, 327693, 65536, 1, 262157, 65536, 1, 196621, 65536, 1, 131085, 65536, 1, 65549, 65536, 1, 917516, 65536, 1, 851980, 65536, 1, 786444, 65536, 1, 720908, 65536, 1, 655372, 65536, 1, 589836, 65536, 1, 524300, 65536, 1, 458764, 65536, 1, 393228, 65536, 1, 327692, 65536, 1, 262156, 65536, 1, 196620, 65536, 1, 131084, 65536, 1, 65548, 65536, 1, 917515, 65536, 1, 851979, 65536, 1, 786443, 65536, 1, 720907, 65536, 1, 655371, 65536, 1, 589835, 65536, 1, 524299, 65536, 1, 458763, 65536, 1, 393227, 65536, 1, 327691, 65536, 1, 262155, 65536, 1, 196619, 65536, 1, 131083, 65536, 1, 65547, 65536, 1, 917514, 65536, 1, 851978, 65536, 1, 786442, 65536, 1, 720906, 65536, 1, 655370, 65536, 1, 589834, 65536, 1, 524298, 65536, 1, 458762, 65536, 1, 393226, 65536, 1, 327690, 65536, 1, 262154, 65536, 1, 196618, 65536, 1, 131082, 65536, 1, 65546, 65536, 1, 917513, 65536, 1, 851977, 65536, 1, 786441, 65536, 1, 720905, 65536, 1, 655369, 65536, 1, 327689, 65536, 1, 262153, 65536, 1, 196617, 65536, 1, 131081, 65536, 1, 65545, 65536, 1, 983048, 65536, 2, 917512, 65536, 1, 851976, 65536, 1, 786440, 65536, 1, 720904, 65536, 1, 655368, 65536, 1, 327688, 65536, 1, 262152, 65536, 1, 196616, 65536, 1, 131080, 65536, 1, 65544, 65536, 1, 8, 65536, 0, 983047, 65536, 2, 917511, 65536, 1, 851975, 65536, 1, 786439, 65536, 1, 720903, 65536, 1, 655367, 65536, 1, 327687, 65536, 1, 262151, 65536, 1, 196615, 65536, 1, 131079, 65536, 1, 65543, 65536, 1, 7, 65536, 0, 917510, 65536, 1, 851974, 65536, 1, 786438, 65536, 1, 720902, 65536, 1, 655366, 65536, 1, 327686, 65536, 1, 262150, 65536, 1, 196614, 65536, 1, 131078, 65536, 1, 65542, 65536, 1, 917509, 65536, 1, 851973, 65536, 1, 786437, 65536, 1, 720901, 65536, 1, 655365, 65536, 1, 589829, 65536, 1, 524293, 65536, 1, 458757, 65536, 1, 393221, 65536, 1, 327685, 65536, 1, 262149, 65536, 1, 196613, 65536, 1, 131077, 65536, 1, 65541, 65536, 1, 917508, 65536, 1, 851972, 65536, 1, 786436, 65536, 1, 720900, 65536, 1, 655364, 65536, 1, 589828, 65536, 1, 524292, 65536, 1, 458756, 65536, 1, 393220, 65536, 1, 327684, 65536, 1, 262148, 65536, 1, 196612, 65536, 1, 131076, 65536, 1, 65540, 65536, 1, 917507, 65536, 1, 851971, 65536, 1, 786435, 65536, 1, 720899, 65536, 1, 655363, 65536, 1, 589827, 65536, 1, 524291, 65536, 1, 458755, 65536, 1, 393219, 65536, 1, 327683, 65536, 1, 262147, 65536, 1, 196611, 65536, 1, 131075, 65536, 1, 65539, 65536, 1, 917506, 65536, 1, 851970, 65536, 1, 786434, 65536, 1, 720898, 65536, 1, 655362, 65536, 1, 589826, 65536, 1, 524290, 65536, 1, 458754, 65536, 1, 393218, 65536, 1, 327682, 65536, 1, 262146, 65536, 1, 196610, 65536, 1, 131074, 65536, 1, 65538, 65536, 1, 917505, 65536, 1, 851969, 65536, 1, 786433, 65536, 1, 720897, 65536, 1, 655361, 65536, 1, 589825, 65536, 1, 524289, 65536, 1, 458753, 65536, 1, 393217, 65536, 1, 327681, 65536, 1, 262145, 65536, 1, 196609, 65536, 1, 131073, 65536, 1, 65537, 65536, 1, 524288, 0, 1, 458752, 0, 1)
diff --git a/player/player.gd b/player/player.gd
index 8034e2c..000d711 100644
--- a/player/player.gd
+++ b/player/player.gd
@@ -6,199 +6,223 @@ const JumpEffect := preload("res://fx/jump.tscn")
const DoubleJumpEffect := preload("res://fx/double_jump.tscn")
const WallJumpEffect := preload("res://fx/wall_dust.tscn")
+## Accel
@export var ACCELERATION := 512
+
+## Topspeed
@export var MAX_SPEED := 64
+
+## Jump force
@export var JUMP_FORCE := 150
+
+## The topspeed at which we slide down the wall
@export var MAX_WALL_SLIDE_SPEED := 110
+
+## The standard speed at which we slide down the wall
@export var WALL_SLIDE_SPEED := 42
+## Friction
@export var FRICTION := 0.25
+
+## How much less movement control to have in the air
@export var AIR_MOVEMENT_MODIFIER := 0.95
-@onready var sprite := $Sprite
+@onready var sprite := $Sprite as Sprite2D
@onready var anims := $Player as AnimationPlayer
-@onready var coyote := $CoyoteJump as Timer
+## The coyote jump timer.
+## Allows you to jump after leaving the ground if the timer has not run out.
+@onready var coyote := $CoyoteJump as Timer
@onready var GRAVITY: float = ProjectSettings.get_setting(&"physics/2d/default_gravity")
func _init() -> void:
- Globals.player = self
+ Globals.player = self
func _exit_tree() -> void:
- Globals.player = null
+ Globals.player = null
+## State enum.
enum State { MOVE, WALL_SLIDE, STOP }
+## Can we double jump now?
var double_jump := true
+
+## The current state, one of the State enums.
var state := State.MOVE
+
+## Have we just jumped?
var just_jumped := false
+var has_hammer := false
func _physics_process(delta: float) -> void:
- just_jumped = false
- match state:
- State.STOP:
- velocity = Vector2.ZERO
- play(&"idle")
- State.MOVE:
- var input := Input.get_axis(&"left", &"right")
- apply_force(input, delta)
- apply_friction(input)
-
- jump_check()
-
- apply_gravity(delta)
-
- animate()
- move()
- wall_slide_check()
- State.WALL_SLIDE:
- play(&"wall_slide")
- var wall_axis := get_wall_axis()
- if wall_axis != 0:
- sprite.scale.x = wall_axis
-
- wall_slide_jump_check(wall_axis)
- wall_slide_drop(delta)
- move()
- wall_detatch(wall_axis, delta)
-
-
+ just_jumped = false
+ match state:
+ State.STOP:
+ velocity = Vector2.ZERO
+ play(&"idle")
+ State.MOVE:
+ var input := Input.get_axis(&"left", &"right")
+ apply_force(input, delta)
+ apply_friction(input)
+
+ jump_check()
+
+ apply_gravity(delta)
+
+ animate()
+ move()
+ wall_slide_check()
+ State.WALL_SLIDE:
+ play(&"wall_slide")
+ var wall_axis := get_wall_axis()
+ if wall_axis != 0:
+ sprite.scale.x = wall_axis
+
+ wall_slide_jump_check(wall_axis)
+ wall_slide_drop(delta)
+ move()
+ wall_detatch(wall_axis, delta)
+
+## Creates floor dust.
func dust() -> void:
- var dust_position := global_position
- dust_position.x += randf_range(-4, 4)
- Utils.instance_scene_on_main(DustEffect, dust_position)
- # SoundFx.play("Step", -20)
-
+ var dust_position := global_position
+ dust_position.x += randf_range(-4, 4)
+ Utils.instance_scene_on_main(DustEffect, dust_position)
+ # SoundFx.play("Step", -20)
+## Applys gravity.
func apply_gravity(delta: float) -> void:
- velocity.y += GRAVITY * delta
- velocity.y = minf(velocity.y, JUMP_FORCE)
-
+ velocity.y += GRAVITY * delta
+ velocity.y = minf(velocity.y, JUMP_FORCE)
+## Applys force with the [param input] of the player.
func apply_force(input: float, delta: float) -> void:
- if input != 0:
- velocity.x += input * ACCELERATION * delta
- velocity.x = clampf(velocity.x, -MAX_SPEED, MAX_SPEED)
- # if not is_on_floor():
- # velocity.x *= AIR_MOVEMENT_MODIFIER
-
+ if input != 0:
+ velocity.x += input * ACCELERATION * delta
+ velocity.x = clampf(velocity.x, -MAX_SPEED, MAX_SPEED)
+ if not is_on_floor():
+ velocity.x *= AIR_MOVEMENT_MODIFIER
+## Applys friction to the player.
func apply_friction(input: float) -> void:
- if input == 0 and not is_zero_approx(velocity.x) and is_on_floor():
- velocity.x = lerpf(velocity.x, 0, FRICTION)
-
+ if input == 0 and not is_zero_approx(velocity.x) and is_on_floor():
+ velocity.x = lerpf(velocity.x, 0, FRICTION)
+## Plays animations for the move state.
func animate() -> void:
- var facing = sign(get_local_mouse_position().x)
- if facing != 0:
- sprite.scale.x = facing
-
- if not is_on_floor():
- play(&"jump")
- return
+ var facing: int = sign(get_local_mouse_position().x)
+ if facing != 0:
+ sprite.scale.x = facing
- if velocity.x != 0:
- play(&"run", clampi(velocity.x * sprite.scale.x, -1, 1))
- else:
- play(&"idle")
+ if not is_on_floor():
+ play(&"jump")
+ return
+ if velocity.x != 0:
+ play(&"run", sign(velocity.x * sprite.scale.x))
+ else:
+ play(&"idle")
+## Plays a [param anim] with a speed of [param speed].
+## If speed is negative, animation plays backwards.
func play(anim: StringName, speed: float = 1.0) -> void:
- anims.play(anim, -1, speed)
+ anims.play(anim, -1, speed)
+## Checks if we should jump.
func jump_check() -> void:
- var want2jump := Input.is_action_just_pressed(&"jump")
- if want2jump and (is_on_floor() or coyote.time_left > 0):
- jump(JUMP_FORCE)
- just_jumped = true
- else:
- if want2jump and velocity.y < -JUMP_FORCE / 2:
- velocity.y = -JUMP_FORCE / 2
-
- if want2jump and double_jump == true:
- double_jump = false
- jump(JUMP_FORCE * .75)
-
-
-func jump(force):
- # SoundFx.play("Jump", -20)
- if double_jump:
- Utils.instance_scene_on_main(JumpEffect, global_position)
- else:
- Utils.instance_scene_on_main(DoubleJumpEffect, global_position)
- velocity.y = -force
-
-
+ var want2jump := Input.is_action_just_pressed(&"jump")
+ if want2jump and (is_on_floor() or coyote.time_left > 0):
+ jump(JUMP_FORCE)
+ just_jumped = true
+ else:
+ if want2jump and velocity.y < -JUMP_FORCE / 2:
+ velocity.y = -JUMP_FORCE / 2
+
+ if want2jump and double_jump == true:
+ double_jump = false
+ jump(JUMP_FORCE * .75)
+
+## Jumps with [param force] force.
+func jump(force: float) -> void:
+ # SoundFx.play("Jump", -20)
+ if double_jump:
+ Utils.instance_scene_on_main(JumpEffect, global_position)
+ else:
+ Utils.instance_scene_on_main(DoubleJumpEffect, global_position)
+ velocity.y = -force
+
+## Uses the velocity to move_and_slide.
func move() -> void:
- var was_in_air := not is_on_floor()
- var was_on_floor := is_on_floor()
- var last_position := position
- var last_velocity := velocity
- move_and_slide()
-
- # landing
- if was_in_air and is_on_floor():
- velocity.x = last_velocity.x
- double_jump = true
- Utils.instance_scene_on_main(JumpEffect, global_position)
-
- # just left ground
- if was_on_floor and not is_on_floor() and not just_jumped:
- position.y = last_position.y
- coyote.start()
- Utils.instance_scene_on_main(JumpEffect, global_position)
-
-
+ var was_in_air := not is_on_floor()
+ var was_on_floor := is_on_floor()
+ var last_position := position
+ var last_velocity := velocity
+ move_and_slide()
+
+ # landing
+ if was_in_air and is_on_floor():
+ velocity.x = last_velocity.x
+ double_jump = true
+ Utils.instance_scene_on_main(JumpEffect, global_position)
+
+ # just left ground
+ if was_on_floor and not is_on_floor() and not just_jumped:
+ position.y = last_position.y
+ coyote.start()
+ Utils.instance_scene_on_main(JumpEffect, global_position)
+
+## Checks if we should enter a wall slide.
func wall_slide_check():
- if not is_on_floor() and is_on_wall_only():
- state = State.WALL_SLIDE
- double_jump = true
- dust()
-
+ if not is_on_floor() and is_on_wall_only():
+ state = State.WALL_SLIDE
+ double_jump = true
+ dust()
+## Checks what wall we are against.
func get_wall_axis() -> int:
- var is_right_wall := test_move(transform, Vector2.RIGHT)
- var is_left_wall := test_move(transform, Vector2.LEFT)
- return int(is_left_wall) - int(is_right_wall)
-
-
-func wall_slide_jump_check(wall_axis) -> void:
- if Input.is_action_just_pressed("jump"):
- velocity.x = wall_axis * MAX_SPEED
- velocity.y = -JUMP_FORCE / 1.25
- state = State.MOVE
- wall_dust(wall_axis)
- # SoundFx.play("Jump", -20)
-
-
+ var is_right_wall := test_move(transform, Vector2.RIGHT)
+ var is_left_wall := test_move(transform, Vector2.LEFT)
+ return int(is_left_wall) - int(is_right_wall)
+
+## Checks if we should jump off the [param wall_axis].
+func wall_slide_jump_check(wall_axis: int) -> void:
+ if Input.is_action_just_pressed("jump"):
+ velocity.x = wall_axis * MAX_SPEED
+ velocity.y = -JUMP_FORCE / 1.25
+ state = State.MOVE
+ wall_dust(wall_axis)
+ # SoundFx.play("Jump", -20)
+
+## Creates dust against the [param wall_axis].
func wall_dust(wall_axis: int) -> void:
- var dust_position = global_position + Vector2(wall_axis * 4, -2)
- var dust_fx := Utils.instance_scene_on_main(WallJumpEffect, dust_position)
- dust_fx.scale.x = wall_axis
+ var dust_position = global_position + Vector2(wall_axis * 4, -2)
+ var dust_fx := Utils.instance_scene_on_main(WallJumpEffect, dust_position) as Node2D
+ dust_fx.scale.x = wall_axis
+## Slides down the wall.
func wall_slide_drop(delta: float) -> void:
- var max_slide_speed = WALL_SLIDE_SPEED
- if Input.is_action_pressed("down"):
- max_slide_speed = MAX_WALL_SLIDE_SPEED
- velocity.y = min(velocity.y + GRAVITY * delta, max_slide_speed)
-
+ var max_slide_speed := WALL_SLIDE_SPEED
+ if Input.is_action_pressed("down"):
+ max_slide_speed = MAX_WALL_SLIDE_SPEED
+ velocity.y = min(velocity.y + GRAVITY * delta, max_slide_speed)
+## Checks if we should detatch from the wall.
func wall_detatch(wall_axis: int, delta: float) -> void:
- var detached := false
- if Input.is_action_just_pressed("right"):
- velocity.x = ACCELERATION * delta
- detached = true
+ var detached := false
+ if Input.is_action_just_pressed("right"):
+ velocity.x = ACCELERATION * delta
+ detached = true
- if Input.is_action_just_pressed("left"):
- velocity.x = -ACCELERATION * delta
- detached = true
+ if Input.is_action_just_pressed("left"):
+ velocity.x = -ACCELERATION * delta
+ detached = true
- if detached:
- state = State.MOVE
- wall_dust(wall_axis)
+ if detached:
+ state = State.MOVE
+ wall_dust(wall_axis)
- if wall_axis == 0 or is_on_floor():
- state = State.MOVE
+ if wall_axis == 0 or is_on_floor():
+ state = State.MOVE
diff --git a/player/player.tscn b/player/player.tscn
index 3c22ede..c7d15d8 100644
--- a/player/player.tscn
+++ b/player/player.tscn
@@ -1,10 +1,10 @@
-[gd_scene load_steps=11 format=3 uid="uid://c1fgxkkh72npw"]
+[gd_scene load_steps=11 format=3 uid="uid://umj2kojm6mlo"]
[ext_resource type="Script" path="res://player/player.gd" id="1_lnsyt"]
[ext_resource type="Texture2D" uid="uid://b36hv0jwfmb1u" path="res://assets/player/animations.png" id="2_dgplu"]
-[ext_resource type="Shape2D" uid="uid://f1oxba248m0l" path="res://player/player_collision.tres" id="3_uoann"]
-[ext_resource type="PackedScene" uid="uid://qliv2erkwokh" path="res://colliders/hurtbox.tscn" id="4_yd6uo"]
-[ext_resource type="PackedScene" uid="uid://cdpkxaateaqdf" path="res://colliders/hitbox.tscn" id="5_wpn72"]
+[ext_resource type="Shape2D" uid="uid://csesrw07xpp24" path="res://player/player_collision.tres" id="3_uoann"]
+[ext_resource type="PackedScene" uid="uid://bgt7m0j1ier74" path="res://colliders/hurtbox.tscn" id="4_yd6uo"]
+[ext_resource type="PackedScene" uid="uid://ug40hxlkequx" path="res://colliders/hitbox.tscn" id="5_wpn72"]
[sub_resource type="Animation" id="Animation_sbyxw"]
resource_name = "idle"
@@ -37,7 +37,7 @@ tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
-"values": [29]
+"values": [9]
}
[sub_resource type="Animation" id="Animation_5lnnm"]
@@ -108,7 +108,8 @@ script = ExtResource("1_lnsyt")
texture_filter = 1
position = Vector2(0, -14)
texture = ExtResource("2_dgplu")
-hframes = 30
+hframes = 11
+frame = 9
[node name="Collision" type="CollisionShape2D" parent="."]
position = Vector2(0, -7)
diff --git a/player/player_collision.tres b/player/player_collision.tres
index 39ec48b..0e954df 100644
--- a/player/player_collision.tres
+++ b/player/player_collision.tres
@@ -1,5 +1,5 @@
-[gd_resource type="CapsuleShape2D" format=3 uid="uid://f1oxba248m0l"]
+[gd_resource type="CapsuleShape2D" format=3 uid="uid://csesrw07xpp24"]
[resource]
-radius = 3.0
+radius = 4.0
height = 14.0
diff --git a/project.godot b/project.godot
index 79f6209..5ee610d 100644
--- a/project.godot
+++ b/project.godot
@@ -101,8 +101,8 @@ config/features=PackedStringArray("4.0")
[autoload]
Utils="*res://autoloads/Utils.gd"
-Events="*res://autoloads/Events.gd"
Globals="*res://autoloads/Globals.gd"
+Events="*res://autoloads/Events.gd"
[debug]
@@ -170,6 +170,10 @@ down={
file_logging/enable_file_logging=true
+[memory]
+
+limits/message_queue/max_size_kb=40960
+
[physics]
2d/run_on_separate_thread=true
@@ -177,7 +181,9 @@ file_logging/enable_file_logging=true
[rendering]
-environment/defaults/default_clear_color=Color(0, 0, 0, 1)
+textures/default_filters/anisotropic_filtering_level=0
+environment/defaults/default_clear_color=Color(0.160784, 0.160784, 0.160784, 1)
+textures/canvas_textures/default_texture_filter=0
quality/driver/driver_name="GLES2"
2d/options/use_nvidia_rect_flicker_workaround=true
quality/intended_usage/framebuffer_allocation=0
diff --git a/world/camera.tscn b/world/camera.tscn
index 5472655..1850621 100644
--- a/world/camera.tscn
+++ b/world/camera.tscn
@@ -1,4 +1,4 @@
-[gd_scene load_steps=2 format=3 uid="uid://dteshgq6omv8k"]
+[gd_scene load_steps=2 format=3 uid="uid://coj5wotnugo56"]
[ext_resource type="Script" path="res://world/camera.gd" id="1_jvai6"]
diff --git a/world/door/block_door.tscn b/world/door/block_door.tscn
index b657460..a50c362 100644
--- a/world/door/block_door.tscn
+++ b/world/door/block_door.tscn
@@ -1,8 +1,8 @@
-[gd_scene load_steps=5 format=3 uid="uid://6rgblwkwaw6v"]
+[gd_scene load_steps=5 format=3 uid="uid://0er8gkqgt7hi"]
[ext_resource type="Script" path="res://world/door/block_door.gd" id="1_tux7r"]
-[ext_resource type="Curve2D" uid="uid://jw0yvthht4bj" path="res://world/door/block_door_path.tres" id="2_57k4a"]
-[ext_resource type="Shape2D" uid="uid://cxidkq2kfr583" path="res://world/door/door_shape.tres" id="4_fq60q"]
+[ext_resource type="Curve2D" path="res://world/door/block_door_path.tres" id="2_57k4a"]
+[ext_resource type="Shape2D" path="res://world/door/door_shape.tres" id="4_fq60q"]
[ext_resource type="Texture2D" uid="uid://dtec6qxbrg3ym" path="res://assets/world/door_wall.png" id="5_ut41x"]
[node name="BlockDoor" type="Node2D" node_paths=PackedStringArray("path_follower")]
diff --git a/world/door/block_door_path.tres b/world/door/block_door_path.tres
index d1e0e64..7686964 100644
--- a/world/door/block_door_path.tres
+++ b/world/door/block_door_path.tres
@@ -1,4 +1,4 @@
-[gd_resource type="Curve2D" format=3 uid="uid://jw0yvthht4bj"]
+[gd_resource type="Curve2D" format=3 uid=""]
[resource]
_data = {
diff --git a/world/door/door.gd b/world/door/door.gd
index dd9afb2..fc5e84b 100644
--- a/world/door/door.gd
+++ b/world/door/door.gd
@@ -4,5 +4,6 @@ class_name Door
## The direction the player should go in when going through this door
var dir: Vector2i
+
func _on_body_entered(_p: Player) -> void:
- Events.change_level.emit(dir)
+ Events.change_level.emit(dir)
diff --git a/world/door/door.tscn b/world/door/door.tscn
index b33e2c1..c22fc6e 100644
--- a/world/door/door.tscn
+++ b/world/door/door.tscn
@@ -1,7 +1,7 @@
-[gd_scene load_steps=4 format=3 uid="uid://b6frlgjdtxsnb"]
+[gd_scene load_steps=4 format=3 uid="uid://dhvalfppnefax"]
[ext_resource type="Script" path="res://world/door/door.gd" id="1_t5c8c"]
-[ext_resource type="Shape2D" uid="uid://cxidkq2kfr583" path="res://world/door/door_shape.tres" id="4_ty3l8"]
+[ext_resource type="Shape2D" path="res://world/door/door_shape.tres" id="4_ty3l8"]
[ext_resource type="Texture2D" uid="uid://ca243eorhvtp2" path="res://assets/world/door.png" id="4_weg0g"]
[node name="door" type="Area2D"]
diff --git a/world/door/door_shape.tres b/world/door/door_shape.tres
index 3415917..f9c0c97 100644
--- a/world/door/door_shape.tres
+++ b/world/door/door_shape.tres
@@ -1,4 +1,4 @@
-[gd_resource type="RectangleShape2D" format=3 uid="uid://cxidkq2kfr583"]
+[gd_resource type="RectangleShape2D" format=3 uid=""]
[resource]
size = Vector2(16, 32)
diff --git a/world/one_way_platform.tscn b/world/one_way_platform.tscn
index 6ca8267..8cfec7f 100644
--- a/world/one_way_platform.tscn
+++ b/world/one_way_platform.tscn
@@ -1,9 +1,9 @@
-[gd_scene load_steps=4 format=3 uid="uid://cbrnw5j2j8wax"]
+[gd_scene load_steps=4 format=3 uid="uid://bkjo2fpkalawa"]
[ext_resource type="Texture2D" uid="uid://b0iehyccoav1r" path="res://assets/world/one_way_platform.png" id="1_3fm0l"]
[ext_resource type="Script" path="res://world/one_way_platform.gd" id="1_3rdiq"]
-[sub_resource type="RectangleShape2D" id="RectangleShape2D_x8my0"]
+[sub_resource type="RectangleShape2D" id="RectangleShape2D_a3f1j"]
size = Vector2(34, 3)
[node name="one_way_platform" type="StaticBody2D" node_paths=PackedStringArray("shape")]
@@ -16,5 +16,5 @@ texture = ExtResource("1_3fm0l")
[node name="CollisionShape" type="CollisionShape2D" parent="."]
position = Vector2(0, -1.5)
-shape = SubResource("RectangleShape2D_x8my0")
+shape = SubResource("RectangleShape2D_a3f1j")
one_way_collision = true
diff --git a/world/tiles.tres b/world/tiles.tres
index 65f5113..2b83e3e 100644
--- a/world/tiles.tres
+++ b/world/tiles.tres
@@ -1,4 +1,4 @@
-[gd_resource type="TileSet" load_steps=6 format=3 uid="uid://dsw8frlrcnbi8"]
+[gd_resource type="TileSet" load_steps=6 format=3 uid="uid://dhq32uplaxvpl"]
[ext_resource type="Texture2D" uid="uid://bs3dt308ypttr" path="res://assets/world/tiles.png" id="1_6jxv4"]
[ext_resource type="Texture2D" uid="uid://b0urvindbx57t" path="res://assets/world/slope.png" id="2_qk6e1"]