From 1351dbb00458525d902d34b39d3524ca0ca7e942 Mon Sep 17 00:00:00 2001 From: Jakob Feldmann Date: Tue, 12 Jul 2022 18:05:34 +0200 Subject: [PATCH] Added 3 simple enemy types The first avoids falling off ledges, the second falls only off of safe ledges and the thirds darts towards the player when he is touching the same unobstructed ground it is on. --- src/Actors/Blobby/Blobby.tscn | 1 - src/Actors/Enemies/Beings/DartingEnemy.gd | 39 ++++++++ src/Actors/Enemies/Beings/DartingEnemy.tscn | 74 +++++++++++++++ src/Actors/Enemies/Beings/Enemy.gd | 6 ++ src/Actors/Enemies/Beings/Enemy.tscn | 15 ++- src/Actors/Enemies/Beings/SimpleEnemy.gd | 39 ++++++++ src/Actors/Enemies/Beings/SimpleEnemy.tscn | 71 ++++++++++++++ src/Actors/Enemies/Beings/SmortEnemy.gd | 39 ++++++++ src/Actors/Enemies/Beings/SmortEnemy.tscn | 76 +++++++++++++++ .../Platform/FlyingLaserCutter.tscn | 11 ++- src/HarmfulObjects/DangerousBlockArea.tscn | 2 +- src/Levels/Enemy Test Level.tscn | 89 ++++++++++++++++++ src/Levels/{1Level.tscn => First Level.tscn} | 34 +++---- src/Levels/Layer 1.png | Bin 1156 -> 0 bytes src/Levels/Layer 1.png.import | 35 ------- ...SizeLevel.tscn => Tile Size 24 Level.tscn} | 16 ++-- src/Levels/Viewport Test Level.gd | 15 --- src/Levels/Viewport Test Level.tscn | 19 +++- src/UserInterface/Screens/MainScreen.tscn | 2 +- 19 files changed, 499 insertions(+), 84 deletions(-) create mode 100644 src/Actors/Enemies/Beings/DartingEnemy.gd create mode 100644 src/Actors/Enemies/Beings/DartingEnemy.tscn create mode 100644 src/Actors/Enemies/Beings/SimpleEnemy.gd create mode 100644 src/Actors/Enemies/Beings/SimpleEnemy.tscn create mode 100644 src/Actors/Enemies/Beings/SmortEnemy.gd create mode 100644 src/Actors/Enemies/Beings/SmortEnemy.tscn create mode 100644 src/Levels/Enemy Test Level.tscn rename src/Levels/{1Level.tscn => First Level.tscn} (94%) delete mode 100644 src/Levels/Layer 1.png delete mode 100644 src/Levels/Layer 1.png.import rename src/Levels/{24TileSizeLevel.tscn => Tile Size 24 Level.tscn} (96%) delete mode 100644 src/Levels/Viewport Test Level.gd diff --git a/src/Actors/Blobby/Blobby.tscn b/src/Actors/Blobby/Blobby.tscn index 4e2408a..83ae3e0 100644 --- a/src/Actors/Blobby/Blobby.tscn +++ b/src/Actors/Blobby/Blobby.tscn @@ -97,7 +97,6 @@ position = Vector2( 0, -16 ) texture = SubResource( 5 ) hframes = 3 vframes = 3 -frame = 7 __meta__ = { "_editor_description_": "YXNlcHJpdGVfd2l6YXJkX2NvbmZpZwpwbGF5ZXJ8PUJsb2JieVNwcml0ZS9CbG9iYnltYXRpb25QbGF5ZXIKc291cmNlfD1yZXM6Ly9hc3NldHMvYmxvYmJ5L2Jsb2JieS1zcHJpdGVzaGVldHQuYXNlcHJpdGUKbGF5ZXJ8PUJsb2JieQpvcF9leHB8PUZhbHNlCm9fZm9sZGVyfD0Kb19uYW1lfD0Kb25seV92aXNpYmxlfD1GYWxzZQpvX2V4X3B8PQo=" } diff --git a/src/Actors/Enemies/Beings/DartingEnemy.gd b/src/Actors/Enemies/Beings/DartingEnemy.gd new file mode 100644 index 0000000..980deb7 --- /dev/null +++ b/src/Actors/Enemies/Beings/DartingEnemy.gd @@ -0,0 +1,39 @@ +extends Player + +export var score := 100 + + +func _ready() -> void: + set_physics_process(false) + + +# TODO adapt to groups +func _on_StompDetector_body_entered(body: Node) -> void: + if body.global_position.y > get_node("StompDetector").global_position.y: + return + get_node("EnemyBody").disabled = true + die() + +func _physics_process(delta: float) -> void: + velocity.y += _gravity * delta + velocity.x = 80 * player_on_floor_direction() + print(velocity.x) + velocity.y = move_and_slide(velocity, FLOOR_NORMAL).y + +# TODO Detects player over gaps +func player_on_floor_direction(): + for raycast in $LedgeDetectorRays.get_children(): + if raycast.is_colliding(): + var collider = raycast.get_collider() + if collider.is_in_group("player"): + return sign(collider.position.x - self.position.x) + return 0 + +func die() -> void: + queue_free() + PlayerData.score += score + +func _on_EnemySkin_area_entered(area:Area2D) -> void: + if area.is_in_group("harmful"): + get_node("EnemyBody").disabled = true + die() diff --git a/src/Actors/Enemies/Beings/DartingEnemy.tscn b/src/Actors/Enemies/Beings/DartingEnemy.tscn new file mode 100644 index 0000000..7365931 --- /dev/null +++ b/src/Actors/Enemies/Beings/DartingEnemy.tscn @@ -0,0 +1,74 @@ +[gd_scene load_steps=6 format=2] + +[ext_resource path="res://assets/enemy/enemy.png" type="Texture" id=1] +[ext_resource path="res://src/Actors/Enemies/Beings/DartingEnemy.gd" type="Script" id=2] + +[sub_resource type="RectangleShape2D" id=1] +extents = Vector2( 2.72463, 1.17848 ) + +[sub_resource type="RectangleShape2D" id=2] +extents = Vector2( 15, 6.12039 ) + +[sub_resource type="RectangleShape2D" id=3] +extents = Vector2( 15.534, 10.0962 ) + +[node name="DartingEnemy" type="KinematicBody2D" groups=["harmful"]] +collision_layer = 2 +collision_mask = 9 +script = ExtResource( 2 ) + +[node name="enemy" type="Sprite" parent="."] +position = Vector2( 0, -1.90735e-06 ) +scale = Vector2( 0.286789, 0.276348 ) +texture = ExtResource( 1 ) + +[node name="VisibilityEnabler2D" type="VisibilityEnabler2D" parent="."] +position = Vector2( 1362.81, -0.138177 ) +scale = Vector2( 15.4865, 1.28502 ) +rect = Rect2( -89, -10, 2, 20 ) +process_parent = true +physics_process_parent = true + +[node name="EnemyBody" type="CollisionShape2D" parent="." groups=["harmful"]] +position = Vector2( 0, 6.48802 ) +scale = Vector2( 5.68128, 5.29182 ) +shape = SubResource( 1 ) + +[node name="StompDetector" type="Area2D" parent="." groups=["weakpoint"]] +modulate = Color( 0, 0.0392157, 1, 1 ) +position = Vector2( 0, -6.44095 ) +collision_layer = 2 +input_pickable = false + +[node name="CollisionShape2D" type="CollisionShape2D" parent="StompDetector"] +position = Vector2( -4.76837e-07, 0.561345 ) +shape = SubResource( 2 ) + +[node name="LedgeDetectorRays" type="Node2D" parent="."] +position = Vector2( -14, 12 ) + +[node name="RayCast2D" type="RayCast2D" parent="LedgeDetectorRays"] +position = Vector2( 1, 0 ) +rotation = 1.5708 +enabled = true +cast_to = Vector2( 0, 1000 ) +collision_mask = 121 + +[node name="RayCast2D2" type="RayCast2D" parent="LedgeDetectorRays"] +position = Vector2( 27, 0 ) +rotation = -1.5708 +enabled = true +cast_to = Vector2( 0, 1000 ) +collision_mask = 121 + +[node name="EnemySkin" type="Area2D" parent="." groups=["player"]] +process_priority = -1 +collision_mask = 126 + +[node name="CollisionPolygon2D" type="CollisionShape2D" parent="EnemySkin"] +position = Vector2( 5.96046e-07, 2.5 ) +scale = Vector2( 1.03, 1.04 ) +shape = SubResource( 3 ) + +[connection signal="body_entered" from="StompDetector" to="." method="_on_StompDetector_body_entered"] +[connection signal="area_entered" from="EnemySkin" to="." method="_on_EnemySkin_area_entered"] diff --git a/src/Actors/Enemies/Beings/Enemy.gd b/src/Actors/Enemies/Beings/Enemy.gd index cde48f8..35d2aae 100644 --- a/src/Actors/Enemies/Beings/Enemy.gd +++ b/src/Actors/Enemies/Beings/Enemy.gd @@ -26,3 +26,9 @@ func _physics_process(delta: float) -> void: func die() -> void: queue_free() PlayerData.score += score + + +func _on_EnemySkin_area_entered(area:Area2D) -> void: + if area.is_in_group("harmful"): + get_node("EnemyBody").disabled = true + die() diff --git a/src/Actors/Enemies/Beings/Enemy.tscn b/src/Actors/Enemies/Beings/Enemy.tscn index cc504ed..0d547a9 100644 --- a/src/Actors/Enemies/Beings/Enemy.tscn +++ b/src/Actors/Enemies/Beings/Enemy.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=5 format=2] +[gd_scene load_steps=6 format=2] [ext_resource path="res://assets/enemy/enemy.png" type="Texture" id=1] [ext_resource path="res://src/Actors/Enemies/Beings/Enemy.gd" type="Script" id=2] @@ -9,6 +9,9 @@ extents = Vector2( 2.72463, 1.17848 ) [sub_resource type="RectangleShape2D" id=2] extents = Vector2( 15.4794, 6.68174 ) +[sub_resource type="RectangleShape2D" id=3] +extents = Vector2( 15.534, 10.0962 ) + [node name="Enemy" type="KinematicBody2D" groups=["harmful"]] collision_layer = 2 collision_mask = 9 @@ -40,4 +43,14 @@ input_pickable = false [node name="CollisionShape2D" type="CollisionShape2D" parent="StompDetector"] shape = SubResource( 2 ) +[node name="EnemySkin" type="Area2D" parent="." groups=["player"]] +process_priority = -1 +collision_mask = 126 + +[node name="CollisionPolygon2D" type="CollisionShape2D" parent="EnemySkin"] +position = Vector2( 5.96046e-07, 2.5 ) +scale = Vector2( 1.03, 1.04 ) +shape = SubResource( 3 ) + [connection signal="body_entered" from="StompDetector" to="." method="_on_StompDetector_body_entered"] +[connection signal="area_entered" from="EnemySkin" to="." method="_on_EnemySkin_area_entered"] diff --git a/src/Actors/Enemies/Beings/SimpleEnemy.gd b/src/Actors/Enemies/Beings/SimpleEnemy.gd new file mode 100644 index 0000000..d75dae2 --- /dev/null +++ b/src/Actors/Enemies/Beings/SimpleEnemy.gd @@ -0,0 +1,39 @@ +extends Player + +export var score := 100 + + +func _ready() -> void: + set_physics_process(false) + velocity.x = -30 + + +# TODO adapt to groups +func _on_StompDetector_body_entered(body: Node) -> void: + if body.global_position.y > get_node("StompDetector").global_position.y: + return + get_node("EnemyBody").disabled = true + die() + + +func _physics_process(delta: float) -> void: + velocity.y += _gravity * delta + if is_on_wall() or is_at_ledge(): + velocity.x *= -1.0 + velocity.y = move_and_slide(velocity, FLOOR_NORMAL).y + +func is_at_ledge(): + for raycast in $LedgeDetectorRays.get_children(): + if !raycast.is_colliding(): + return true + return false + +func die() -> void: + queue_free() + PlayerData.score += score + + +func _on_EnemySkin_area_entered(area:Area2D) -> void: + if area.is_in_group("harmful"): + get_node("EnemyBody").disabled = true + die() diff --git a/src/Actors/Enemies/Beings/SimpleEnemy.tscn b/src/Actors/Enemies/Beings/SimpleEnemy.tscn new file mode 100644 index 0000000..e3ec9c5 --- /dev/null +++ b/src/Actors/Enemies/Beings/SimpleEnemy.tscn @@ -0,0 +1,71 @@ +[gd_scene load_steps=6 format=2] + +[ext_resource path="res://assets/enemy/enemy.png" type="Texture" id=1] +[ext_resource path="res://src/Actors/Enemies/Beings/SimpleEnemy.gd" type="Script" id=2] + +[sub_resource type="RectangleShape2D" id=1] +extents = Vector2( 2.72463, 1.17848 ) + +[sub_resource type="RectangleShape2D" id=2] +extents = Vector2( 15.4794, 6.68174 ) + +[sub_resource type="RectangleShape2D" id=3] +extents = Vector2( 15.534, 10.0962 ) + +[node name="SimpleEnemy" type="KinematicBody2D" groups=["harmful"]] +collision_layer = 2 +collision_mask = 9 +script = ExtResource( 2 ) + +[node name="enemy" type="Sprite" parent="."] +position = Vector2( 0, -1.90735e-06 ) +scale = Vector2( 0.286789, 0.276348 ) +texture = ExtResource( 1 ) + +[node name="VisibilityEnabler2D" type="VisibilityEnabler2D" parent="."] +position = Vector2( 1362.81, -0.138177 ) +scale = Vector2( 15.4865, 1.28502 ) +rect = Rect2( -89, -10, 2, 20 ) +process_parent = true +physics_process_parent = true + +[node name="EnemyBody" type="CollisionShape2D" parent="." groups=["harmful"]] +position = Vector2( 0, 6.48802 ) +scale = Vector2( 5.68128, 5.29182 ) +shape = SubResource( 1 ) + +[node name="StompDetector" type="Area2D" parent="." groups=["weakpoint"]] +modulate = Color( 0, 0.0392157, 1, 1 ) +position = Vector2( 0, -6.44095 ) +collision_layer = 2 +input_pickable = false + +[node name="CollisionShape2D" type="CollisionShape2D" parent="StompDetector"] +shape = SubResource( 2 ) + +[node name="LedgeDetectorRays" type="Node2D" parent="."] +position = Vector2( -14, 12 ) + +[node name="RayCast2D" type="RayCast2D" parent="LedgeDetectorRays"] +position = Vector2( 1, 0 ) +enabled = true +cast_to = Vector2( 0, 2 ) +collision_mask = 120 + +[node name="RayCast2D2" type="RayCast2D" parent="LedgeDetectorRays"] +position = Vector2( 27, 0 ) +enabled = true +cast_to = Vector2( 0, 2 ) +collision_mask = 120 + +[node name="EnemySkin" type="Area2D" parent="." groups=["player"]] +process_priority = -1 +collision_mask = 126 + +[node name="CollisionPolygon2D" type="CollisionShape2D" parent="EnemySkin"] +position = Vector2( 5.96046e-07, 2.5 ) +scale = Vector2( 1.03, 1.04 ) +shape = SubResource( 3 ) + +[connection signal="body_entered" from="StompDetector" to="." method="_on_StompDetector_body_entered"] +[connection signal="area_entered" from="EnemySkin" to="." method="_on_EnemySkin_area_entered"] diff --git a/src/Actors/Enemies/Beings/SmortEnemy.gd b/src/Actors/Enemies/Beings/SmortEnemy.gd new file mode 100644 index 0000000..6343ee4 --- /dev/null +++ b/src/Actors/Enemies/Beings/SmortEnemy.gd @@ -0,0 +1,39 @@ +extends Player + +export var score := 100 + + +func _ready() -> void: + set_physics_process(false) + velocity.x = -30 + + +# TODO adapt to groups +func _on_StompDetector_body_entered(body: Node) -> void: + if body.global_position.y > get_node("StompDetector").global_position.y: + return + get_node("EnemyBody").disabled = true + die() + +func _physics_process(delta: float) -> void: + velocity.y += _gravity * delta + if is_on_wall() or !is_safe_drop(): + velocity.x *= -1.0 + velocity.y = move_and_slide(velocity, FLOOR_NORMAL).y + +func is_safe_drop(): + for raycast in $LedgeDetectorRays.get_children(): + if raycast.is_colliding(): + var collider = raycast.get_collider() + if collider.is_in_group("harmful"): + return false + return true + +func die() -> void: + queue_free() + PlayerData.score += score + +func _on_EnemySkin_area_entered(area:Area2D) -> void: + if area.is_in_group("harmful"): + get_node("EnemyBody").disabled = true + die() diff --git a/src/Actors/Enemies/Beings/SmortEnemy.tscn b/src/Actors/Enemies/Beings/SmortEnemy.tscn new file mode 100644 index 0000000..6f6b499 --- /dev/null +++ b/src/Actors/Enemies/Beings/SmortEnemy.tscn @@ -0,0 +1,76 @@ +[gd_scene load_steps=6 format=2] + +[ext_resource path="res://assets/enemy/enemy.png" type="Texture" id=1] +[ext_resource path="res://src/Actors/Enemies/Beings/SmortEnemy.gd" type="Script" id=2] + +[sub_resource type="RectangleShape2D" id=1] +extents = Vector2( 2.72463, 1.17848 ) + +[sub_resource type="RectangleShape2D" id=2] +extents = Vector2( 15, 6.12039 ) + +[sub_resource type="RectangleShape2D" id=3] +extents = Vector2( 15.534, 10.0962 ) + +[node name="SmortEnemy" type="KinematicBody2D" groups=["harmful"]] +collision_layer = 2 +collision_mask = 9 +script = ExtResource( 2 ) + +[node name="enemy" type="Sprite" parent="."] +position = Vector2( 0, -1.90735e-06 ) +scale = Vector2( 0.286789, 0.276348 ) +texture = ExtResource( 1 ) + +[node name="VisibilityEnabler2D" type="VisibilityEnabler2D" parent="."] +position = Vector2( 1362.81, -0.138177 ) +scale = Vector2( 15.4865, 1.28502 ) +rect = Rect2( -89, -10, 2, 20 ) +process_parent = true +physics_process_parent = true + +[node name="EnemyBody" type="CollisionShape2D" parent="." groups=["harmful"]] +position = Vector2( 0, 6.48802 ) +scale = Vector2( 5.68128, 5.29182 ) +shape = SubResource( 1 ) + +[node name="StompDetector" type="Area2D" parent="." groups=["weakpoint"]] +modulate = Color( 0, 0.0392157, 1, 1 ) +position = Vector2( 0, -6.44095 ) +collision_layer = 2 +input_pickable = false + +[node name="CollisionShape2D" type="CollisionShape2D" parent="StompDetector"] +position = Vector2( -4.76837e-07, 0.561345 ) +shape = SubResource( 2 ) + +[node name="LedgeDetectorRays" type="Node2D" parent="."] +position = Vector2( -14, 12 ) + +[node name="RayCast2D" type="RayCast2D" parent="LedgeDetectorRays"] +position = Vector2( 1, 0 ) +enabled = true +cast_to = Vector2( 0, 1000 ) +collision_mask = 120 +collide_with_areas = true +collide_with_bodies = false + +[node name="RayCast2D2" type="RayCast2D" parent="LedgeDetectorRays"] +position = Vector2( 27, 0 ) +enabled = true +cast_to = Vector2( 0, 1000 ) +collision_mask = 120 +collide_with_areas = true +collide_with_bodies = false + +[node name="EnemySkin" type="Area2D" parent="." groups=["player"]] +process_priority = -1 +collision_mask = 126 + +[node name="CollisionPolygon2D" type="CollisionShape2D" parent="EnemySkin"] +position = Vector2( 5.96046e-07, 2.5 ) +scale = Vector2( 1.03, 1.04 ) +shape = SubResource( 3 ) + +[connection signal="body_entered" from="StompDetector" to="." method="_on_StompDetector_body_entered"] +[connection signal="area_entered" from="EnemySkin" to="." method="_on_EnemySkin_area_entered"] diff --git a/src/Contraptions/Platform/FlyingLaserCutter.tscn b/src/Contraptions/Platform/FlyingLaserCutter.tscn index 476d97b..23cfad4 100644 --- a/src/Contraptions/Platform/FlyingLaserCutter.tscn +++ b/src/Contraptions/Platform/FlyingLaserCutter.tscn @@ -2,7 +2,7 @@ [ext_resource path="res://src/Contraptions/Platform/FlyingLaserCutter.gd" type="Script" id=1] -[sub_resource type="StreamTexture" id=6] +[sub_resource type="StreamTexture" id=5] load_path = "res://.import/FlyingLaserCutter.png-9cf80385a79c58041216f8c2509a5bab.stex" [sub_resource type="Animation" id=2] @@ -36,31 +36,36 @@ collision_mask = 57 collision/safe_margin = 0.001 [node name="Sprite" type="Sprite" parent="FlyingLaserCutterBody"] -texture = SubResource( 6 ) +texture = SubResource( 5 ) hframes = 5 vframes = 5 +frame = 21 __meta__ = { -"_editor_description_": "YXNlcHJpdGVfd2l6YXJkX2NvbmZpZwpwbGF5ZXJ8PVNwcml0ZS9BbmltYXRpb25QbGF5ZXIKc291cmNlfD1yZXM6Ly9hc3NldHMvY29udHJhcHRpb24vRmx5aW5nTGFzZXJDdXR0ZXIuYXNlcHJpdGUKbGF5ZXJ8PQpvcF9leHB8PUZhbHNlCm9fZm9sZGVyfD0Kb19uYW1lfD0Kb25seV92aXNpYmxlfD1GYWxzZQpvX2V4X3B8PQo=" +"_editor_description_": "YXNlcHJpdGVfd2l6YXJkX2NvbmZpZwpwbGF5ZXJ8PUZseWluZ0xhc2VyQ3V0dGVyQm9keS9TcHJpdGUvQW5pbWF0aW9uUGxheWVyCnNvdXJjZXw9cmVzOi8vYXNzZXRzL2NvbnRyYXB0aW9uL0ZseWluZ0xhc2VyQ3V0dGVyLmFzZXByaXRlCmxheWVyfD0Kb3BfZXhwfD1GYWxzZQpvX2ZvbGRlcnw9Cm9fbmFtZXw9Cm9ubHlfdmlzaWJsZXw9RmFsc2UKb19leF9wfD0K" } [node name="AnimationPlayer" type="AnimationPlayer" parent="FlyingLaserCutterBody/Sprite"] anims/default = SubResource( 2 ) [node name="CollisionShape2D" type="CollisionShape2D" parent="FlyingLaserCutterBody"] +visible = false position = Vector2( -0.461, 0 ) shape = SubResource( 3 ) [node name="LaserArea" type="Area2D" parent="FlyingLaserCutterBody" groups=["harmful"]] process_priority = -1 +visible = false collision_layer = 32 collision_mask = 3 [node name="PainZone" type="CollisionShape2D" parent="FlyingLaserCutterBody/LaserArea" groups=["harmful"]] process_priority = -1 +visible = false position = Vector2( 9.64728, 0.0077219 ) shape = SubResource( 4 ) [node name="Triggers" type="Node2D" parent="FlyingLaserCutterBody"] +visible = false position = Vector2( 0, 0.0077219 ) [node name="RayCast2D" type="RayCast2D" parent="FlyingLaserCutterBody/Triggers"] diff --git a/src/HarmfulObjects/DangerousBlockArea.tscn b/src/HarmfulObjects/DangerousBlockArea.tscn index 1e58a5c..1a27b55 100644 --- a/src/HarmfulObjects/DangerousBlockArea.tscn +++ b/src/HarmfulObjects/DangerousBlockArea.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=2 format=2] [sub_resource type="RectangleShape2D" id=1] -extents = Vector2( 12, 12 ) +extents = Vector2( 11, 11 ) [node name="DangerousBlockArea" type="Node2D" groups=["harmful"]] diff --git a/src/Levels/Enemy Test Level.tscn b/src/Levels/Enemy Test Level.tscn new file mode 100644 index 0000000..18c9443 --- /dev/null +++ b/src/Levels/Enemy Test Level.tscn @@ -0,0 +1,89 @@ +[gd_scene load_steps=11 format=2] + +[ext_resource path="res://src/Actors/Blobby/Blobby.tscn" type="PackedScene" id=1] +[ext_resource path="res://assets/environment/blocks/24BlockBasic.png" type="Texture" id=2] +[ext_resource path="res://src/UserInterface/Buttons/UI.tscn" type="PackedScene" id=3] +[ext_resource path="res://src/HarmfulObjects/Spikes.tscn" type="PackedScene" id=4] +[ext_resource path="res://src/Actors/Enemies/Beings/Enemy.tscn" type="PackedScene" id=5] +[ext_resource path="res://src/Actors/Enemies/Beings/SimpleEnemy.tscn" type="PackedScene" id=6] +[ext_resource path="res://src/Actors/Enemies/Beings/SmortEnemy.tscn" type="PackedScene" id=7] +[ext_resource path="res://src/Actors/Enemies/Beings/DartingEnemy.tscn" type="PackedScene" id=8] + +[sub_resource type="ConvexPolygonShape2D" id=3] +points = PoolVector2Array( 0, 0, 24, 0, 24, 24, 0, 24 ) + +[sub_resource type="TileSet" id=2] +1/name = "24BlockBasic.png 1" +1/texture = ExtResource( 2 ) +1/tex_offset = Vector2( 0, 0 ) +1/modulate = Color( 1, 1, 1, 1 ) +1/region = Rect2( 0, 0, 24, 24 ) +1/tile_mode = 0 +1/occluder_offset = Vector2( 0, 0 ) +1/navigation_offset = Vector2( 0, 0 ) +1/shape_offset = Vector2( 0, 0 ) +1/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +1/shape = SubResource( 3 ) +1/shape_one_way = false +1/shape_one_way_margin = 1.0 +1/shapes = [ { +"autotile_coord": Vector2( 0, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 3 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +} ] +1/z_index = 0 + +[node name="LevelTemplate" type="Node2D"] +__meta__ = { +"_edit_horizontal_guides_": [ 464.0 ], +"_edit_vertical_guides_": [ 2880.0 ] +} + +[node name="UserInterface" parent="." instance=ExtResource( 3 )] + +[node name="Blobby" parent="." instance=ExtResource( 1 )] +position = Vector2( -259.915, 710.547 ) + +[node name="SmortEnemy" parent="." instance=ExtResource( 7 )] +position = Vector2( 220, 804 ) + +[node name="Enemy" parent="." instance=ExtResource( 5 )] +position = Vector2( 0, 780 ) + +[node name="Enemy2" parent="." instance=ExtResource( 6 )] +position = Vector2( 492, 804 ) + +[node name="DartingEnemy" parent="." instance=ExtResource( 8 )] +position = Vector2( 800, 875 ) + +[node name="Spikes" parent="." instance=ExtResource( 4 )] +position = Vector2( -180, 900 ) + +[node name="Spikes3" parent="." instance=ExtResource( 4 )] +position = Vector2( 108, 900 ) + +[node name="Spikes5" parent="." instance=ExtResource( 4 )] +position = Vector2( 372, 900 ) + +[node name="Spikes4" parent="." instance=ExtResource( 4 )] +position = Vector2( 132, 900 ) + +[node name="Spikes6" parent="." instance=ExtResource( 4 )] +position = Vector2( 348, 900 ) + +[node name="Spikes2" parent="." instance=ExtResource( 4 )] +position = Vector2( -156, 900 ) + +[node name="TileMap" type="TileMap" parent="."] +tile_set = SubResource( 2 ) +cell_size = Vector2( 24, 24 ) +cell_quadrant_size = 24 +cell_custom_transform = Transform2D( 24, 0, 0, 24, 0, 0 ) +collision_use_kinematic = true +collision_friction = 0.0 +collision_layer = 8 +collision_mask = 0 +format = 1 +tile_data = PoolIntArray( 1179634, 1, 0, 1245170, 1, 0, 1310706, 1, 0, 1376242, 1, 0, 1441778, 1, 0, 1507314, 1, 0, 1572850, 1, 0, 1638386, 1, 0, 1703922, 1, 0, 1769458, 1, 0, 1834994, 1, 0, 1900530, 1, 0, 1966066, 1, 0, 1966069, 536870912, 0, 1966071, 1, 0, 1900544, 0, 0, 2031602, 1, 0, 2031603, 1, 0, 2031604, 1, 0, 2031605, 1, 0, 2031606, 1, 0, 2031607, 1, 0, 1966080, 0, 0, 2097138, 1, 0, 2097139, 1, 0, 2097140, 1, 0, 2097141, 1, 0, 2097142, 1, 0, 2097143, 1, 0, 2162674, 1, 0, 2162679, 1, 0, 2228210, 1, 0, 2228215, 1, 0, 2228220, 1, 0, 2228221, 1, 0, 2228222, 1, 0, 2228223, 1, 0, 2162688, 1, 0, 2162726, 1, 0, 2293746, 1, 0, 2293751, 1, 0, 2228230, 1, 0, 2228231, 1, 0, 2228232, 1, 0, 2228233, 1, 0, 2228234, 1, 0, 2228235, 1, 0, 2228242, 1, 0, 2228243, 1, 0, 2228244, 1, 0, 2228245, 1, 0, 2228246, 1, 0, 2228262, 1, 0, 2359282, 1, 0, 2359287, 1, 0, 2293798, 1, 0, 2424818, 1, 0, 2424823, 1, 0, 2424827, 1, 0, 2359323, 1, 0, 2359334, 1, 0, 2490354, 1, 0, 2490355, 1, 0, 2490356, 1, 0, 2490357, 1, 0, 2490358, 1, 0, 2490359, 1, 0, 2490362, 1, 0, 2490363, 1, 0, 2490364, 1, 0, 2490365, 1, 0, 2490366, 1, 0, 2490367, 1, 0, 2424832, 1, 0, 2424833, 1, 0, 2424834, 1, 0, 2424835, 1, 0, 2424838, 1, 0, 2424839, 1, 0, 2424840, 1, 0, 2424841, 1, 0, 2424842, 1, 0, 2424843, 1, 0, 2424844, 1, 0, 2424845, 1, 0, 2424848, 1, 0, 2424849, 1, 0, 2424850, 1, 0, 2424851, 1, 0, 2424852, 1, 0, 2424853, 1, 0, 2424854, 1, 0, 2424855, 1, 0, 2424856, 1, 0, 2424857, 1, 0, 2424858, 1, 0, 2424859, 1, 0, 2424860, 1, 0, 2424861, 1, 0, 2424862, 1, 0, 2424863, 1, 0, 2424864, 1, 0, 2424865, 1, 0, 2424866, 1, 0, 2424867, 1, 0, 2424868, 1, 0, 2424869, 1, 0, 2424870, 1, 0, 2555895, 1, 0, 2555896, 1, 0, 2555897, 1, 0, 2555898, 1, 0, 2555899, 1, 0, 2555900, 1, 0, 2555901, 1, 0, 2555902, 1, 0, 2555903, 1, 0, 2490368, 1, 0, 2490369, 1, 0, 2490370, 1, 0, 2490371, 1, 0, 2490372, 1, 0, 2490373, 1, 0, 2490374, 1, 0, 2490375, 1, 0, 2490376, 1, 0, 2490377, 1, 0, 2490378, 1, 0, 2490379, 1, 0, 2490380, 1, 0, 2490381, 1, 0, 2490382, 1, 0, 2490383, 1, 0 ) diff --git a/src/Levels/1Level.tscn b/src/Levels/First Level.tscn similarity index 94% rename from src/Levels/1Level.tscn rename to src/Levels/First Level.tscn index 4602a94..b815a8a 100644 --- a/src/Levels/1Level.tscn +++ b/src/Levels/First Level.tscn @@ -1,19 +1,19 @@ [gd_scene load_steps=10 format=2] -[ext_resource path="res://src/Actors/Blobby/Blobby.tscn" type="PackedScene" id=1] -[ext_resource path="res://assets/environment/blocks/24BlockBasic.png" type="Texture" id=2] -[ext_resource path="res://src/UserInterface/Buttons/UI.tscn" type="PackedScene" id=3] -[ext_resource path="res://src/Contraptions/Portal/Portal.tscn" type="PackedScene" id=4] +[ext_resource path="res://assets/environment/blocks/24BlockBasic.png" type="Texture" id=1] +[ext_resource path="res://src/Actors/Blobby/Blobby.tscn" type="PackedScene" id=2] +[ext_resource path="res://src/Contraptions/Portal/Portal.tscn" type="PackedScene" id=3] +[ext_resource path="res://src/Contraptions/Platform/FlyingLaserCutter.tscn" type="PackedScene" id=4] [ext_resource path="res://src/NeutralObjects/Coin.tscn" type="PackedScene" id=5] -[ext_resource path="res://src/Contraptions/Platform/FlyingLaserCutter.tscn" type="PackedScene" id=6] -[ext_resource path="res://src/HarmfulObjects/Spikes.tscn" type="PackedScene" id=7] +[ext_resource path="res://src/HarmfulObjects/Spikes.tscn" type="PackedScene" id=6] +[ext_resource path="res://src/UserInterface/Buttons/UI.tscn" type="PackedScene" id=7] [sub_resource type="ConvexPolygonShape2D" id=3] points = PoolVector2Array( 0, 0, 24, 0, 24, 24, 0, 24 ) [sub_resource type="TileSet" id=2] 1/name = "24BlockBasic.png 1" -1/texture = ExtResource( 2 ) +1/texture = ExtResource( 1 ) 1/tex_offset = Vector2( 0, 0 ) 1/modulate = Color( 1, 1, 1, 1 ) 1/region = Rect2( 0, 0, 24, 24 ) @@ -40,9 +40,9 @@ __meta__ = { "_edit_vertical_guides_": [ 2880.0 ] } -[node name="UserInterface" parent="." instance=ExtResource( 3 )] +[node name="UserInterface" parent="." instance=ExtResource( 7 )] -[node name="Blobby" parent="." instance=ExtResource( 1 )] +[node name="Blobby" parent="." instance=ExtResource( 2 )] position = Vector2( -259.915, 710.547 ) [node name="TileMap" type="TileMap" parent="."] @@ -56,31 +56,31 @@ collision_mask = 8 format = 1 tile_data = PoolIntArray( 720882, 1, 0, 720883, 1, 0, 720884, 1, 0, 720885, 1, 0, 720886, 1, 0, 720887, 1, 0, 720888, 1, 0, 720889, 1, 0, 720890, 1, 0, 720891, 1, 0, 720892, 1, 0, 720893, 1, 0, 720894, 1, 0, 720895, 1, 0, 655360, 1, 0, 655361, 1, 0, 655362, 1, 0, 655363, 1, 0, 655364, 1, 0, 655365, 1, 0, 655366, 1, 0, 655367, 1, 0, 655368, 1, 0, 655369, 1, 0, 655370, 1, 0, 655371, 1, 0, 655372, 1, 0, 655373, 1, 0, 655374, 1, 0, 655375, 1, 0, 655376, 1, 0, 655377, 1, 0, 655378, 1, 0, 655379, 1, 0, 655380, 1, 0, 655381, 1, 0, 655382, 1, 0, 655383, 1, 0, 655384, 1, 0, 655385, 1, 0, 655386, 1, 0, 655387, 1, 0, 655388, 1, 0, 655389, 1, 0, 655390, 1, 0, 655391, 1, 0, 655392, 1, 0, 655393, 1, 0, 655394, 1, 0, 655395, 1, 0, 655396, 1, 0, 655397, 1, 0, 655398, 1, 0, 655399, 1, 0, 655400, 1, 0, 655401, 1, 0, 655402, 1, 0, 655403, 1, 0, 655404, 1, 0, 655405, 1, 0, 655406, 1, 0, 655407, 1, 0, 655408, 1, 0, 655409, 1, 0, 655410, 1, 0, 655411, 1, 0, 655412, 1, 0, 655413, 1, 0, 655414, 1, 0, 655415, 1, 0, 655416, 1, 0, 655417, 1, 0, 655418, 1, 0, 655419, 1, 0, 655420, 1, 0, 655421, 1, 0, 655422, 1, 0, 655423, 1, 0, 655424, 1, 0, 655425, 1, 0, 655426, 1, 0, 655427, 1, 0, 655428, 1, 0, 655429, 1, 0, 655430, 1, 0, 655431, 1, 0, 655432, 1, 0, 655433, 1, 0, 655434, 1, 0, 655435, 1, 0, 655436, 1, 0, 655437, 1, 0, 655438, 1, 0, 655439, 1, 0, 655440, 1, 0, 655441, 1, 0, 655442, 1, 0, 655443, 1, 0, 655444, 1, 0, 655445, 1, 0, 786418, 1, 0, 720981, 1, 0, 851954, 1, 0, 786517, 1, 0, 917490, 1, 0, 852053, 1, 0, 983026, 1, 0, 917589, 1, 0, 1048562, 1, 0, 983125, 1, 0, 1114098, 1, 0, 1048661, 1, 0, 1179634, 1, 0, 1114197, 1, 0, 1245170, 1, 0, 1179733, 1, 0, 1310706, 1, 0, 1245184, 1, 0, 1245185, 1, 0, 1245186, 1, 0, 1245187, 1, 0, 1245188, 1, 0, 1245189, 1, 0, 1245190, 1, 0, 1245193, 1, 0, 1245194, 1, 0, 1245198, 1, 0, 1245199, 1, 0, 1245203, 1, 0, 1245204, 1, 0, 1245205, 1, 0, 1245206, 1, 0, 1245211, 1, 0, 1245212, 1, 0, 1245215, 1, 0, 1245219, 1, 0, 1245220, 1, 0, 1245221, 1, 0, 1245225, 1, 0, 1245226, 1, 0, 1245229, 1, 0, 1245230, 1, 0, 1245233, 1, 0, 1245234, 1, 0, 1245269, 1, 0, 1376242, 536870913, 0, 1310720, 1, 0, 1310721, 1, 0, 1310722, 1, 0, 1310723, 1, 0, 1310724, 1, 0, 1310725, 1, 0, 1310726, 1, 0, 1310805, 1, 0, 1441778, 536870913, 0, 1376256, 1, 0, 1376257, 1, 0, 1376258, 1, 0, 1376259, 1, 0, 1376260, 1, 0, 1376261, 1, 0, 1376262, 1, 0, 1376309, 1, 0, 1376310, 1, 0, 1376311, 1, 0, 1376312, 1, 0, 1376313, 1, 0, 1376314, 1, 0, 1376315, 1, 0, 1376316, 1, 0, 1376317, 1, 0, 1376318, 1, 0, 1376319, 1, 0, 1376320, 1, 0, 1376321, 1, 0, 1376322, 1, 0, 1376323, 1, 0, 1376324, 1, 0, 1376325, 1, 0, 1376326, 1, 0, 1376327, 1, 0, 1376328, 1, 0, 1376329, 1, 0, 1376330, 1, 0, 1376331, 1, 0, 1376332, 1, 0, 1376333, 1, 0, 1376334, 1, 0, 1376335, 1, 0, 1376336, 1, 0, 1376337, 1, 0, 1376338, 1, 0, 1376339, 1, 0, 1376340, 1, 0, 1376341, 1, 0, 1507314, 536870913, 0, 1441792, 1, 0, 1441793, 1, 0, 1441794, 1, 0, 1441795, 1, 0, 1441796, 1, 0, 1441797, 1, 0, 1441798, 1, 0, 1441865, 1, 0, 1441866, 1, 0, 1441867, 1, 0, 1441868, 1, 0, 1441869, 1, 0, 1441877, 1, 0, 1572850, 536870913, 0, 1507328, 1, 0, 1507329, 1, 0, 1507330, 1, 0, 1507331, 1, 0, 1507332, 1, 0, 1507333, 1, 0, 1507334, 1, 0, 1507377, 1, 0, 1507378, 1, 0, 1507402, 1, 0, 1507403, 1, 0, 1507404, 1, 0, 1507405, 1, 0, 1507413, 1, 0, 1638386, 536870913, 0, 1572864, 1, 0, 1572865, 1, 0, 1572866, 1, 0, 1572867, 1, 0, 1572868, 1, 0, 1572869, 1, 0, 1572870, 1, 0, 1572914, 1, 0, 1572915, 1, 0, 1572938, 1, 0, 1572939, 1, 0, 1572940, 1, 0, 1572941, 1, 0, 1572949, 1, 0, 1703922, 536870913, 0, 1638400, 1, 0, 1638401, 1, 0, 1638402, 1, 0, 1638403, 1, 0, 1638404, 1, 0, 1638405, 1, 0, 1638406, 1, 0, 1638475, 1, 0, 1638476, 1, 0, 1638477, 1, 0, 1638485, 1, 0, 1769458, 536870913, 0, 1703936, 1, 0, 1703937, 1, 0, 1703938, 1, 0, 1703939, 1, 0, 1703940, 1, 0, 1703941, 1, 0, 1703942, 1, 0, 1703984, 1, 0, 1703985, 1, 0, 1703986, 1, 0, 1703987, 1, 0, 1703988, 1, 0, 1703989, 1, 0, 1704011, 1, 0, 1704012, 1, 0, 1704013, 1, 0, 1704016, 1, 0, 1704017, 1, 0, 1704018, 1, 0, 1704021, 1, 0, 1834994, 536870913, 0, 1769472, 1, 0, 1769473, 1, 0, 1769474, 1, 0, 1769475, 1, 0, 1769476, 1, 0, 1769477, 1, 0, 1769478, 1, 0, 1769549, 1, 0, 1769557, 1, 0, 1900530, 536870913, 0, 1835008, 1, 0, 1835009, 1, 0, 1835010, 1, 0, 1835011, 1, 0, 1835012, 1, 0, 1835031, 1, 0, 1835032, 1, 0, 1835052, 1, 0, 1835053, 1, 0, 1835093, 1, 0, 1966066, 536870913, 0, 1966069, 536870912, 0, 1900544, 1, 0, 1900545, 1, 0, 1900546, 1, 0, 1900547, 1, 0, 1900566, 1, 0, 1900567, 1, 0, 1900568, 1, 0, 1900569, 1, 0, 1900588, 1, 0, 1900589, 1, 0, 1900607, 1, 0, 1900608, 1, 0, 1900629, 1, 0, 2031602, 536870913, 0, 1966080, 0, 0, 1966090, 1, 0, 1966091, 1, 0, 1966092, 1, 0, 1966093, 1, 0, 1966094, 1, 0, 1966095, 1, 0, 1966096, 1, 0, 1966097, 1, 0, 1966098, 1, 0, 1966099, 1, 0, 1966100, 1, 0, 1966101, 1, 0, 1966102, 1, 0, 1966103, 1, 0, 1966104, 1, 0, 1966105, 1, 0, 1966106, 1, 0, 1966107, 1, 0, 1966108, 1, 0, 1966109, 1, 0, 1966110, 1, 0, 1966111, 1, 0, 1966112, 1, 0, 1966116, 1, 0, 1966117, 1, 0, 1966118, 1, 0, 1966119, 1, 0, 1966120, 1, 0, 1966121, 1, 0, 1966122, 1, 0, 1966123, 1, 0, 1966124, 1, 0, 1966125, 1, 0, 1966126, 1, 0, 1966127, 1, 0, 1966128, 1, 0, 1966129, 1, 0, 1966130, 1, 0, 1966131, 1, 0, 1966132, 1, 0, 1966133, 1, 0, 1966134, 1, 0, 1966135, 1, 0, 1966136, 1, 0, 1966137, 1, 0, 1966138, 1, 0, 1966143, 1, 0, 1966144, 1, 0, 1966149, 1, 0, 1966150, 1, 0, 1966151, 1, 0, 1966152, 1, 0, 1966153, 1, 0, 1966154, 1, 0, 1966155, 1, 0, 1966156, 1, 0, 1966157, 1, 0, 1966158, 1, 0, 1966159, 1, 0, 1966160, 1, 0, 1966161, 1, 0, 1966162, 1, 0, 1966163, 1, 0, 1966164, 1, 0, 1966165, 1, 0, 2097138, 536870913, 0, 2097139, 536870913, 0, 2097140, 536870913, 0, 2097141, 536870913, 0, 2097142, 1, 0, 2097143, 1, 0, 2097144, 1, 0, 2097145, 1, 0, 2097146, 1, 0, 2097147, 1, 0, 2097148, 1, 0, 2097149, 1, 0, 2097150, 1, 0, 2097151, 1, 0, 2031616, 1, 0, 2031617, 1, 0, 2031618, 1, 0, 2031619, 1, 0, 2031620, 1, 0, 2031621, 1, 0, 2031622, 1, 0, 2031623, 1, 0, 2031624, 1, 0, 2031625, 1, 0, 2031626, 1, 0, 2031627, 1, 0, 2031628, 1, 0, 2031629, 1, 0, 2031630, 1, 0, 2031631, 1, 0, 2031632, 1, 0, 2031633, 1, 0, 2031634, 1, 0, 2031635, 1, 0, 2031636, 1, 0, 2031637, 1, 0, 2031638, 1, 0, 2031639, 1, 0, 2031640, 1, 0, 2031641, 1, 0, 2031642, 1, 0, 2031643, 1, 0, 2031644, 1, 0, 2031645, 1, 0, 2031646, 1, 0, 2031647, 1, 0, 2031648, 1, 0, 2031649, 1, 0, 2031650, 1, 0, 2031651, 1, 0, 2031652, 1, 0, 2031653, 1, 0, 2031654, 1, 0, 2031655, 1, 0, 2031656, 1, 0, 2031657, 1, 0, 2031658, 1, 0, 2031659, 1, 0, 2031660, 1, 0, 2031661, 1, 0, 2031662, 1, 0, 2031663, 1, 0, 2031664, 1, 0, 2031665, 1, 0, 2031666, 1, 0, 2031667, 1, 0, 2031668, 1, 0, 2031669, 1, 0, 2031670, 1, 0, 2031671, 1, 0, 2031672, 1, 0, 2031673, 1, 0, 2031674, 1, 0, 2031675, 1, 0, 2031676, 1, 0, 2031677, 1, 0, 2031678, 1, 0, 2031679, 1, 0, 2031680, 1, 0, 2031681, 1, 0, 2031682, 1, 0, 2031683, 1, 0, 2031684, 1, 0, 2031685, 1, 0, 2031686, 1, 0, 2031687, 1, 0, 2031688, 1, 0, 2031689, 1, 0, 2031690, 1, 0, 2031691, 1, 0, 2031692, 1, 0, 2031693, 1, 0, 2031694, 1, 0, 2031695, 1, 0, 2031696, 1, 0, 2031697, 1, 0, 2031698, 1, 0, 2031699, 1, 0, 2031700, 1, 0, 2031701, 1, 0 ) -[node name="Portal" parent="." instance=ExtResource( 4 )] +[node name="Portal" parent="." instance=ExtResource( 3 )] position = Vector2( 1989, 528 ) [node name="Collectibles" type="Node" parent="."] [node name="Coin" parent="Collectibles" instance=ExtResource( 5 )] -position = Vector2( -168, 612 ) +position = Vector2( -168, 602 ) scale = Vector2( 0.15, 0.15 ) [node name="AnimatedSprite" parent="Collectibles/Coin" index="2"] position = Vector2( 0, -2 ) -frame = 224 +frame = 170 -[node name="FlyingLaserCutter3" parent="." instance=ExtResource( 6 )] -position = Vector2( -168, 636 ) +[node name="FlyingLaserCutter3" parent="." instance=ExtResource( 4 )] +position = Vector2( -168, 624 ) rotation = 1.5708 -[node name="FlyingLaserCutter4" parent="." instance=ExtResource( 6 )] +[node name="FlyingLaserCutter4" parent="." instance=ExtResource( 4 )] position = Vector2( -300, 576 ) -[node name="FlyingLaserCutter5" parent="." instance=ExtResource( 6 )] +[node name="FlyingLaserCutter5" parent="." instance=ExtResource( 4 )] position = Vector2( -12.2599, 516.921 ) rotation = -3.14159 -[node name="Spikes" parent="." instance=ExtResource( 7 )] +[node name="Spikes" parent="." instance=ExtResource( 6 )] position = Vector2( 1572, 732 ) [editable path="Collectibles/Coin"] diff --git a/src/Levels/Layer 1.png b/src/Levels/Layer 1.png deleted file mode 100644 index 58e1d2e0c728980cc7c718d927633eeaee8d8fd4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1156 zcmV-~1bh35P)Px(K1oDDRCt{2n>}t@F$~94i7hpFgxViW(%2 z$F%EJ)M2Ip;I01>4HEkjVS#eEl>mu-fbOgxjVI#D|NcA=qCvxMHInvAq5?PC5+`go zZBc;4KEOw(qus~pC4>;*?Ch=Cd9!@4^f&i<-B|m86GP6tbY=knISX;Q#6eZh94WI!!wwWewe9xpe_BRjKWKkK z2%7K3_OI_B#2V(!GR&K0m@OK%4EpY%{m=P;8jZbuUofk*WVb$Q&*e1C77YM&w}$Pe z-76o1GrRdzmd7a!($O zCmn~!zX5#g$5Pvg?rgnMxu^^Gzc>IyW!5+r%sETq0BjTg=A0VAdoO+~Qb4|P=lT_q z^q)dJ08t3nQ2LN6IZF%m08IIPdkX*ne_vkUE-7C*ARUJ2ziI#g^2@N}fTUbs2jFcm z+Tr+ibp^k6pYL8@S*O)t-G6of+Vu)1=NGWuw4Kq5%PZ%Ep&Srr;CIDCk$Xky z3c!P)bwaHJ+Vu)1u)lQiOF@ZR$8(b}wyEuZ4)H%?(Rf7qFlAm3MX#aQKIcqM2UT8R z-^4bjh5C*e<40Lsj2X9bCP10*Hl3Ku6GfN7fZ5k|O)qW=anY z>b|F1sQQ%s;%TT-18y&^TXhntv{|aJngEKjRQpu@PjO42zSlKT?rUFchl%fY?FG2{?Z@!j;ox$x!w=a`E{9Hc1-R zs0JX;+*41|!14J2_DLF+RHY~#GfU+Zk~Az~(^LWY_;^XiBnCU6a6DihpI?!ma8Ok5 z<0;%B9Ht^hzt void: - scaling = screen_res / level_viewport.size - print(screen_res) - print(level_viewport.size) - print(scaling) - level_viewport_container.rect_scale *= scaling \ No newline at end of file diff --git a/src/Levels/Viewport Test Level.tscn b/src/Levels/Viewport Test Level.tscn index 5ac10bb..a45b44e 100644 --- a/src/Levels/Viewport Test Level.tscn +++ b/src/Levels/Viewport Test Level.tscn @@ -1,9 +1,24 @@ [gd_scene load_steps=2 format=2] -[ext_resource path="res://src/Levels/Viewport Test Level.gd" type="Script" id=1] +[sub_resource type="GDScript" id=1] +script/source = "extends Node2D + +onready var level_viewport_container = $ViewportContainer +onready var level_viewport = $ViewportContainer/Viewport +onready var screen_res = get_viewport().size + +var scaling = Vector2() + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + scaling = screen_res / level_viewport.size + print(screen_res) + print(level_viewport.size) + print(scaling) + level_viewport_container.rect_scale *= scaling" [node name="ViewportTestLevel" type="Node2D"] -script = ExtResource( 1 ) +script = SubResource( 1 ) [node name="ViewportContainer" type="ViewportContainer" parent="."] margin_right = 1920.0 diff --git a/src/UserInterface/Screens/MainScreen.tscn b/src/UserInterface/Screens/MainScreen.tscn index 8e071c7..a23dffb 100644 --- a/src/UserInterface/Screens/MainScreen.tscn +++ b/src/UserInterface/Screens/MainScreen.tscn @@ -52,7 +52,7 @@ size_flags_horizontal = 3 [node name="PlayButton" parent="MenuContainer/Buttons" instance=ExtResource( 3 )] margin_right = 296.0 margin_bottom = 48.0 -next_scene_path = "res://src/Levels/24TileSizeLevel.tscn" +next_scene_path = "res://src/Levels/Enemy Test Level.tscn" [node name="QuitButton" parent="MenuContainer/Buttons" instance=ExtResource( 1 )] anchor_left = 0.0