diff options
author | Daniel Weipert <code@drogueronin.de> | 2023-08-10 11:48:05 +0200 |
---|---|---|
committer | Daniel Weipert <code@drogueronin.de> | 2023-08-10 11:48:05 +0200 |
commit | 46556d864b9685c3b09a0038f5de83966fe7ff94 (patch) | |
tree | c68082eacd35559e14565d1598dd694972fb8e0e /Scenes |
Initial commit
Diffstat (limited to 'Scenes')
39 files changed, 2892 insertions, 0 deletions
diff --git a/Scenes/Components/MapArea.gd b/Scenes/Components/MapArea.gd new file mode 100644 index 0000000..f46216a --- /dev/null +++ b/Scenes/Components/MapArea.gd @@ -0,0 +1,75 @@ +extends Area2D + + +func _ready(): + self.add_area_edges() + + +func add_area_edges(): + var area_edges = StaticBody2D.new() + area_edges.set_collision_layer_value(Utilities.Collision.Layer.SOLID, true) + area_edges.add_collision_exception_with(Global.player) + + var bounds = Utilities.get_collision_shape_bounds($CollisionShape2D) + var edges = [ + { "a": bounds.position, "b": Vector2(bounds.end.x, bounds.position.y) }, + { "a": bounds.position, "b": Vector2(bounds.position.x, bounds.end.y) }, + { "a": bounds.end, "b": Vector2(bounds.end.x, bounds.position.y) }, + { "a": bounds.end, "b": Vector2(bounds.position.x, bounds.end.y) }, + ] + + for edge in edges: + var collision_shape = CollisionShape2D.new() + var shape = SegmentShape2D.new() + shape.a = edge.a + shape.b = edge.b + collision_shape.shape = shape + area_edges.add_child(collision_shape) + + add_child(area_edges) + + +func _on_body_entered(body): + if body is Player: + self._on_player_entered(body) + + +func _on_player_entered(player: Player): + var exited_area = Global.last_area + + $TileMap.process_mode = PROCESS_MODE_INHERIT + $TileMap.visible = true + + self.adjust_camera_to_area(player) + + if exited_area: + exited_area.get_node("TileMap").process_mode = PROCESS_MODE_DISABLED + + var tween = get_tree().create_tween() + tween.tween_property( + player, "position", player.position + player.DIRECTION * 16, 1.25 + ) + tween.tween_callback(func(): + exited_area.get_node("TileMap").visible = false + ) + + Global.last_area = self + + +func adjust_camera_to_area(player: Player) -> Camera2D: + var camera: Camera2D = player.get_node("Camera2D") + var bounds: Rect2 = Utilities.get_collision_shape_bounds($CollisionShape2D) + #var enter_direction_vector = player.position - collision_shape.position + + var duration = 0 + if Global.last_area: + duration = 1.25 + + var tween = get_tree().create_tween().set_parallel().set_ease(Tween.EASE_OUT) + + tween.tween_property(camera, "limit_top", bounds.position.y, duration) + tween.tween_property(camera, "limit_right", bounds.end.x, duration) + tween.tween_property(camera, "limit_bottom", bounds.end.y, duration) + tween.tween_property(camera, "limit_left", bounds.position.x, duration) + + return camera diff --git a/Scenes/Components/MapArea.tscn b/Scenes/Components/MapArea.tscn new file mode 100644 index 0000000..fddb2b7 --- /dev/null +++ b/Scenes/Components/MapArea.tscn @@ -0,0 +1,22 @@ +[gd_scene load_steps=4 format=3 uid="uid://difwuijv2rlx5"] + +[ext_resource type="Script" path="res://Scenes/Components/MapArea.gd" id="1_lknuu"] +[ext_resource type="PackedScene" uid="uid://d0t04jox4oxsv" path="res://Scenes/Components/TileMap.tscn" id="2_e336r"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_744ux"] +size = Vector2(240, 160) + +[node name="MapArea" type="Area2D"] +collision_layer = 0 +collision_mask = 2 +script = ExtResource("1_lknuu") + +[node name="CollisionShapeBase" type="CollisionShape2D" parent="."] +visible = false +shape = SubResource("RectangleShape2D_744ux") +disabled = true +debug_color = Color(0, 0.639216, 0.345098, 0.419608) + +[node name="TileMap" parent="." instance=ExtResource("2_e336r")] + +[connection signal="body_entered" from="." to="." method="_on_body_entered"] diff --git a/Scenes/Components/PlayerPosition.gd b/Scenes/Components/PlayerPosition.gd new file mode 100644 index 0000000..2391c8e --- /dev/null +++ b/Scenes/Components/PlayerPosition.gd @@ -0,0 +1,3 @@ +extends Node2D + +class_name PlayerPosition diff --git a/Scenes/Components/PlayerPosition.tscn b/Scenes/Components/PlayerPosition.tscn new file mode 100644 index 0000000..b1ec9f9 --- /dev/null +++ b/Scenes/Components/PlayerPosition.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=3 uid="uid://cluuq4bwb8ebs"] + +[ext_resource type="Script" path="res://Scenes/Components/PlayerPosition.gd" id="1_rgv2q"] + +[node name="PlayerPosition" type="Node2D"] +script = ExtResource("1_rgv2q") diff --git a/Scenes/Components/SceneTransition.gd b/Scenes/Components/SceneTransition.gd new file mode 100644 index 0000000..ee01938 --- /dev/null +++ b/Scenes/Components/SceneTransition.gd @@ -0,0 +1,68 @@ +extends Area2D + + +@export_file() var sceneFilePath +@export var targetPlayerPositionNodePath: String + +var scene: Node + + +func _ready(): + self.scene = load(self.sceneFilePath).instantiate() + + +func _on_body_entered(body: Node2D): + if body.is_in_group("player"): + var player = body.duplicate(DUPLICATE_USE_INSTANTIATION) + body.process_mode = Node.PROCESS_MODE_DISABLED + +# var img_current = get_viewport().get_texture().get_image() +# var viewport = get_viewport_rect() +# img_current.resize(viewport.size.x, viewport.size.y) +# $Sprite2D.texture = ImageTexture.create_from_image(img_current) +# +# var camera: Camera2D = body.get_node("Camera2D") +# $Sprite2D.global_position = camera.get_screen_center_position() +# +# var tween = create_tween() +# tween.tween_property($Sprite2D, "modulate", Color(0, 0, 0, 1), 0.75) + var tween = Utilities.fade_screen(Color(0, 0, 0, 0), Color(0, 0, 0, 1), 0.75) + tween.connect("finished", func(): + Utilities.change_scene_with_player_to_position( + self.scene, player, NodePath(targetPlayerPositionNodePath) + ) + ) + + +#func adjust_camera_to_tilemap(camera: Camera2D, tileMap: TileMap) -> Camera2D: +# var tileMapRect = tileMap.get_used_rect() +# var visibleCorrectionVector = Vector2(tileMap.cell_quadrant_size / 2.0, tileMap.cell_quadrant_size / 2.0) +# var localRect = Rect2( +# tileMap.map_to_local(tileMapRect.position) - visibleCorrectionVector, +# tileMap.map_to_local(tileMapRect.size) - visibleCorrectionVector +# ) +# var viewportRect = get_viewport_rect() +# +# if abs(localRect.end.x) >= abs(viewportRect.end.x): +# camera.set_limit(SIDE_LEFT, localRect.position.x) +# else: +# camera.set_limit(SIDE_LEFT, -10000000) +# +# if abs(localRect.end.y) >= abs(viewportRect.end.y): +# camera.set_limit(SIDE_TOP, localRect.position.y) +# else: +# camera.set_limit(SIDE_TOP, -10000000) +# +# if abs(localRect.end.x) >= abs(viewportRect.end.x): +# camera.set_limit(SIDE_RIGHT, localRect.end.x) +# else: +# camera.set_limit(SIDE_RIGHT, 10000000) +# +# if abs(localRect.end.y) >= abs(viewportRect.end.y): +# camera.set_limit(SIDE_BOTTOM, localRect.end.y) +# else: +# camera.set_limit(SIDE_BOTTOM, 10000000) +# +# print(tileMapRect, localRect, viewportRect) +# +# return camera diff --git a/Scenes/Components/SceneTransition.tscn b/Scenes/Components/SceneTransition.tscn new file mode 100644 index 0000000..81a8842 --- /dev/null +++ b/Scenes/Components/SceneTransition.tscn @@ -0,0 +1,19 @@ +[gd_scene load_steps=3 format=3 uid="uid://c5ix2njry0181"] + +[ext_resource type="Script" path="res://Scenes/Components/SceneTransition.gd" id="1_3hbkh"] + +[sub_resource type="SegmentShape2D" id="SegmentShape2D_wg5kv"] +a = Vector2(0, -1) +b = Vector2(0, 1) + +[node name="SceneTransition" type="Area2D"] +collision_layer = 0 +collision_mask = 2 +script = ExtResource("1_3hbkh") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("SegmentShape2D_wg5kv") + +[node name="Sprite2D" type="Sprite2D" parent="."] + +[connection signal="body_entered" from="." to="." method="_on_body_entered"] diff --git a/Scenes/Components/TileMap.gd b/Scenes/Components/TileMap.gd new file mode 100644 index 0000000..961bf5e --- /dev/null +++ b/Scenes/Components/TileMap.gd @@ -0,0 +1,5 @@ +extends TileMap + + +func _ready(): + visible = false diff --git a/Scenes/Components/TileMap.tscn b/Scenes/Components/TileMap.tscn new file mode 100644 index 0000000..8ce096b --- /dev/null +++ b/Scenes/Components/TileMap.tscn @@ -0,0 +1,873 @@ +[gd_scene load_steps=7 format=3 uid="uid://d0t04jox4oxsv"] + +[ext_resource type="Texture2D" uid="uid://5dk0c1kpvdgs" path="res://Assets/bomb_party_v4.png" id="1_aov43"] +[ext_resource type="PackedScene" uid="uid://bugyo0c505kdw" path="res://Scenes/Entities/Objects/Box.tscn" id="1_fy8qx"] +[ext_resource type="Script" path="res://Scenes/Components/TileMap.gd" id="3_e12vf"] + +[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_gfeqr"] +texture = ExtResource("1_aov43") +0:0/0 = 0 +0:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:0/0/physics_layer_0/angular_velocity = 0.0 +1:0/0 = 0 +1:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:0/0/physics_layer_0/angular_velocity = 0.0 +2:0/0 = 0 +2:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:0/0/physics_layer_0/angular_velocity = 0.0 +3:0/0 = 0 +3:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:0/0/physics_layer_0/angular_velocity = 0.0 +4:0/0 = 0 +4:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:0/0/physics_layer_0/angular_velocity = 0.0 +5:0/0 = 0 +5:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:0/0/physics_layer_0/angular_velocity = 0.0 +6:0/0 = 0 +6:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:0/0/physics_layer_0/angular_velocity = 0.0 +7:0/0 = 0 +7:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:0/0/physics_layer_0/angular_velocity = 0.0 +8:0/0 = 0 +8:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:0/0/physics_layer_0/angular_velocity = 0.0 +9:0/0 = 0 +9:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:0/0/physics_layer_0/angular_velocity = 0.0 +10:0/0 = 0 +10:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:0/0/physics_layer_0/angular_velocity = 0.0 +11:0/0 = 0 +11:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:0/0/physics_layer_0/angular_velocity = 0.0 +12:0/0 = 0 +12:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:0/0/physics_layer_0/angular_velocity = 0.0 +13:0/0 = 0 +13:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:0/0/physics_layer_0/angular_velocity = 0.0 +14:0/0 = 0 +14:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:0/0/physics_layer_0/angular_velocity = 0.0 +0:1/0 = 0 +0:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:1/0/physics_layer_0/angular_velocity = 0.0 +1:1/0 = 0 +1:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:1/0/physics_layer_0/angular_velocity = 0.0 +2:1/0 = 0 +2:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:1/0/physics_layer_0/angular_velocity = 0.0 +3:1/0 = 0 +3:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:1/0/physics_layer_0/angular_velocity = 0.0 +4:1/0 = 0 +4:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:1/0/physics_layer_0/angular_velocity = 0.0 +5:1/0 = 0 +5:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:1/0/physics_layer_0/angular_velocity = 0.0 +6:1/0 = 0 +6:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:1/0/physics_layer_0/angular_velocity = 0.0 +7:1/0 = 0 +7:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:1/0/physics_layer_0/angular_velocity = 0.0 +8:1/0 = 0 +8:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:1/0/physics_layer_0/angular_velocity = 0.0 +9:1/0 = 0 +9:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:1/0/physics_layer_0/angular_velocity = 0.0 +10:1/0 = 0 +10:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:1/0/physics_layer_0/angular_velocity = 0.0 +11:1/0 = 0 +11:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:1/0/physics_layer_0/angular_velocity = 0.0 +12:1/0 = 0 +12:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:1/0/physics_layer_0/angular_velocity = 0.0 +13:1/0 = 0 +13:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:1/0/physics_layer_0/angular_velocity = 0.0 +14:1/0 = 0 +14:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:1/0/physics_layer_0/angular_velocity = 0.0 +0:2/0 = 0 +0:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:2/0/physics_layer_0/angular_velocity = 0.0 +1:2/0 = 0 +1:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:2/0/physics_layer_0/angular_velocity = 0.0 +2:2/0 = 0 +2:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:2/0/physics_layer_0/angular_velocity = 0.0 +3:2/0 = 0 +3:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:2/0/physics_layer_0/angular_velocity = 0.0 +4:2/0 = 0 +4:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:2/0/physics_layer_0/angular_velocity = 0.0 +5:2/0 = 0 +5:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:2/0/physics_layer_0/angular_velocity = 0.0 +6:2/0 = 0 +6:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:2/0/physics_layer_0/angular_velocity = 0.0 +7:2/0 = 0 +7:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:2/0/physics_layer_0/angular_velocity = 0.0 +8:2/0 = 0 +8:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:2/0/physics_layer_0/angular_velocity = 0.0 +9:2/0 = 0 +9:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:2/0/physics_layer_0/angular_velocity = 0.0 +10:2/0 = 0 +10:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:2/0/physics_layer_0/angular_velocity = 0.0 +11:2/0 = 0 +11:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:2/0/physics_layer_0/angular_velocity = 0.0 +12:2/0 = 0 +12:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:2/0/physics_layer_0/angular_velocity = 0.0 +13:2/0 = 0 +13:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:2/0/physics_layer_0/angular_velocity = 0.0 +14:2/0 = 0 +14:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:2/0/physics_layer_0/angular_velocity = 0.0 +0:3/0 = 0 +0:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:3/0/physics_layer_0/angular_velocity = 0.0 +1:3/0 = 0 +1:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:3/0/physics_layer_0/angular_velocity = 0.0 +2:3/0 = 0 +2:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:3/0/physics_layer_0/angular_velocity = 0.0 +3:3/0 = 0 +3:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:3/0/physics_layer_0/angular_velocity = 0.0 +4:3/0 = 0 +4:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:3/0/physics_layer_0/angular_velocity = 0.0 +5:3/0 = 0 +5:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:3/0/physics_layer_0/angular_velocity = 0.0 +6:3/0 = 0 +6:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:3/0/physics_layer_0/angular_velocity = 0.0 +7:3/0 = 0 +7:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:3/0/physics_layer_0/angular_velocity = 0.0 +8:3/0 = 0 +8:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:3/0/physics_layer_0/angular_velocity = 0.0 +9:3/0 = 0 +9:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:3/0/physics_layer_0/angular_velocity = 0.0 +10:3/0 = 0 +10:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:3/0/physics_layer_0/angular_velocity = 0.0 +11:3/0 = 0 +11:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:3/0/physics_layer_0/angular_velocity = 0.0 +12:3/0 = 0 +12:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:3/0/physics_layer_0/angular_velocity = 0.0 +13:3/0 = 0 +13:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:3/0/physics_layer_0/angular_velocity = 0.0 +14:3/0 = 0 +14:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:3/0/physics_layer_0/angular_velocity = 0.0 +0:4/0 = 0 +0:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:4/0/physics_layer_0/angular_velocity = 0.0 +1:4/0 = 0 +1:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:4/0/physics_layer_0/angular_velocity = 0.0 +2:4/0 = 0 +2:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:4/0/physics_layer_0/angular_velocity = 0.0 +3:4/0 = 0 +3:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:4/0/physics_layer_0/angular_velocity = 0.0 +4:4/0 = 0 +4:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:4/0/physics_layer_0/angular_velocity = 0.0 +5:4/0 = 0 +5:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:4/0/physics_layer_0/angular_velocity = 0.0 +6:4/0 = 0 +6:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:4/0/physics_layer_0/angular_velocity = 0.0 +7:4/0 = 0 +7:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:4/0/physics_layer_0/angular_velocity = 0.0 +8:4/0 = 0 +8:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:4/0/physics_layer_0/angular_velocity = 0.0 +9:4/0 = 0 +9:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:4/0/physics_layer_0/angular_velocity = 0.0 +10:4/0 = 0 +10:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:4/0/physics_layer_0/angular_velocity = 0.0 +11:4/0 = 0 +11:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:4/0/physics_layer_0/angular_velocity = 0.0 +12:4/0 = 0 +12:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:4/0/physics_layer_0/angular_velocity = 0.0 +13:4/0 = 0 +13:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:4/0/physics_layer_0/angular_velocity = 0.0 +14:4/0 = 0 +14:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:4/0/physics_layer_0/angular_velocity = 0.0 +0:5/0 = 0 +0:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:5/0/physics_layer_0/angular_velocity = 0.0 +1:5/0 = 0 +1:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:5/0/physics_layer_0/angular_velocity = 0.0 +2:5/0 = 0 +2:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:5/0/physics_layer_0/angular_velocity = 0.0 +3:5/0 = 0 +3:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:5/0/physics_layer_0/angular_velocity = 0.0 +4:5/0 = 0 +4:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:5/0/physics_layer_0/angular_velocity = 0.0 +5:5/0 = 0 +5:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:5/0/physics_layer_0/angular_velocity = 0.0 +6:5/0 = 0 +6:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:5/0/physics_layer_0/angular_velocity = 0.0 +7:5/0 = 0 +7:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:5/0/physics_layer_0/angular_velocity = 0.0 +8:5/0 = 0 +8:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:5/0/physics_layer_0/angular_velocity = 0.0 +9:5/0 = 0 +9:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:5/0/physics_layer_0/angular_velocity = 0.0 +10:5/0 = 0 +10:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:5/0/physics_layer_0/angular_velocity = 0.0 +11:5/0 = 0 +11:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:5/0/physics_layer_0/angular_velocity = 0.0 +12:5/0 = 0 +12:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:5/0/physics_layer_0/angular_velocity = 0.0 +13:5/0 = 0 +13:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:5/0/physics_layer_0/angular_velocity = 0.0 +14:5/0 = 0 +14:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:5/0/physics_layer_0/angular_velocity = 0.0 +0:6/0 = 0 +0:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:6/0/physics_layer_0/angular_velocity = 0.0 +1:6/0 = 0 +1:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:6/0/physics_layer_0/angular_velocity = 0.0 +2:6/0 = 0 +2:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:6/0/physics_layer_0/angular_velocity = 0.0 +3:6/0 = 0 +3:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:6/0/physics_layer_0/angular_velocity = 0.0 +4:6/0 = 0 +4:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:6/0/physics_layer_0/angular_velocity = 0.0 +5:6/0 = 0 +5:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:6/0/physics_layer_0/angular_velocity = 0.0 +6:6/0 = 0 +6:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:6/0/physics_layer_0/angular_velocity = 0.0 +7:6/0 = 0 +7:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:6/0/physics_layer_0/angular_velocity = 0.0 +8:6/0 = 0 +8:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:6/0/physics_layer_0/angular_velocity = 0.0 +9:6/0 = 0 +9:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:6/0/physics_layer_0/angular_velocity = 0.0 +10:6/0 = 0 +10:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:6/0/physics_layer_0/angular_velocity = 0.0 +11:6/0 = 0 +11:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:6/0/physics_layer_0/angular_velocity = 0.0 +12:6/0 = 0 +12:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:6/0/physics_layer_0/angular_velocity = 0.0 +13:6/0 = 0 +13:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:6/0/physics_layer_0/angular_velocity = 0.0 +14:6/0 = 0 +14:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:6/0/physics_layer_0/angular_velocity = 0.0 +0:7/0 = 0 +0:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:7/0/physics_layer_0/angular_velocity = 0.0 +1:7/0 = 0 +1:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:7/0/physics_layer_0/angular_velocity = 0.0 +2:7/0 = 0 +2:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:7/0/physics_layer_0/angular_velocity = 0.0 +3:7/0 = 0 +3:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:7/0/physics_layer_0/angular_velocity = 0.0 +4:7/0 = 0 +4:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:7/0/physics_layer_0/angular_velocity = 0.0 +5:7/0 = 0 +5:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:7/0/physics_layer_0/angular_velocity = 0.0 +6:7/0 = 0 +6:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:7/0/physics_layer_0/angular_velocity = 0.0 +7:7/0 = 0 +7:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:7/0/physics_layer_0/angular_velocity = 0.0 +8:7/0 = 0 +8:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:7/0/physics_layer_0/angular_velocity = 0.0 +9:7/0 = 0 +9:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:7/0/physics_layer_0/angular_velocity = 0.0 +10:7/0 = 0 +10:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:7/0/physics_layer_0/angular_velocity = 0.0 +11:7/0 = 0 +11:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:7/0/physics_layer_0/angular_velocity = 0.0 +12:7/0 = 0 +12:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:7/0/physics_layer_0/angular_velocity = 0.0 +13:7/0 = 0 +13:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:7/0/physics_layer_0/angular_velocity = 0.0 +14:7/0 = 0 +14:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:7/0/physics_layer_0/angular_velocity = 0.0 +0:8/0 = 0 +0:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:8/0/physics_layer_0/angular_velocity = 0.0 +1:8/0 = 0 +1:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:8/0/physics_layer_0/angular_velocity = 0.0 +2:8/0 = 0 +2:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:8/0/physics_layer_0/angular_velocity = 0.0 +3:8/0 = 0 +3:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:8/0/physics_layer_0/angular_velocity = 0.0 +4:8/0 = 0 +4:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:8/0/physics_layer_0/angular_velocity = 0.0 +5:8/0 = 0 +5:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:8/0/physics_layer_0/angular_velocity = 0.0 +6:8/0 = 0 +6:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:8/0/physics_layer_0/angular_velocity = 0.0 +7:8/0 = 0 +7:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:8/0/physics_layer_0/angular_velocity = 0.0 +8:8/0 = 0 +8:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:8/0/physics_layer_0/angular_velocity = 0.0 +9:8/0 = 0 +9:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:8/0/physics_layer_0/angular_velocity = 0.0 +10:8/0 = 0 +10:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:8/0/physics_layer_0/angular_velocity = 0.0 +11:8/0 = 0 +11:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:8/0/physics_layer_0/angular_velocity = 0.0 +12:8/0 = 0 +12:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:8/0/physics_layer_0/angular_velocity = 0.0 +13:8/0 = 0 +13:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:8/0/physics_layer_0/angular_velocity = 0.0 +14:8/0 = 0 +14:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:8/0/physics_layer_0/angular_velocity = 0.0 +0:9/0 = 0 +0:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:9/0/physics_layer_0/angular_velocity = 0.0 +1:9/0 = 0 +1:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:9/0/physics_layer_0/angular_velocity = 0.0 +2:9/0 = 0 +2:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:9/0/physics_layer_0/angular_velocity = 0.0 +3:9/0 = 0 +3:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:9/0/physics_layer_0/angular_velocity = 0.0 +4:9/0 = 0 +4:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:9/0/physics_layer_0/angular_velocity = 0.0 +5:9/0 = 0 +5:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:9/0/physics_layer_0/angular_velocity = 0.0 +6:9/0 = 0 +6:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:9/0/physics_layer_0/angular_velocity = 0.0 +7:9/0 = 0 +7:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:9/0/physics_layer_0/angular_velocity = 0.0 +8:9/0 = 0 +8:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:9/0/physics_layer_0/angular_velocity = 0.0 +9:9/0 = 0 +9:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:9/0/physics_layer_0/angular_velocity = 0.0 +10:9/0 = 0 +10:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:9/0/physics_layer_0/angular_velocity = 0.0 +11:9/0 = 0 +11:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:9/0/physics_layer_0/angular_velocity = 0.0 +12:9/0 = 0 +12:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:9/0/physics_layer_0/angular_velocity = 0.0 +13:9/0 = 0 +13:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:9/0/physics_layer_0/angular_velocity = 0.0 +14:9/0 = 0 +14:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:9/0/physics_layer_0/angular_velocity = 0.0 +0:10/0 = 0 +0:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:10/0/physics_layer_0/angular_velocity = 0.0 +1:10/0 = 0 +1:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:10/0/physics_layer_0/angular_velocity = 0.0 +2:10/0 = 0 +2:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:10/0/physics_layer_0/angular_velocity = 0.0 +3:10/0 = 0 +3:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:10/0/physics_layer_0/angular_velocity = 0.0 +4:10/0 = 0 +4:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:10/0/physics_layer_0/angular_velocity = 0.0 +5:10/0 = 0 +5:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:10/0/physics_layer_0/angular_velocity = 0.0 +6:10/0 = 0 +6:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:10/0/physics_layer_0/angular_velocity = 0.0 +7:10/0 = 0 +7:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:10/0/physics_layer_0/angular_velocity = 0.0 +8:10/0 = 0 +8:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:10/0/physics_layer_0/angular_velocity = 0.0 +9:10/0 = 0 +9:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:10/0/physics_layer_0/angular_velocity = 0.0 +10:10/0 = 0 +10:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:10/0/physics_layer_0/angular_velocity = 0.0 +11:10/0 = 0 +11:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:10/0/physics_layer_0/angular_velocity = 0.0 +12:10/0 = 0 +12:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:10/0/physics_layer_0/angular_velocity = 0.0 +13:10/0 = 0 +13:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:10/0/physics_layer_0/angular_velocity = 0.0 +14:10/0 = 0 +14:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:10/0/physics_layer_0/angular_velocity = 0.0 +0:11/0 = 0 +0:11/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:11/0/physics_layer_0/angular_velocity = 0.0 +1:11/0 = 0 +1:11/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:11/0/physics_layer_0/angular_velocity = 0.0 +2:11/0 = 0 +2:11/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:11/0/physics_layer_0/angular_velocity = 0.0 +3:11/0 = 0 +3:11/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:11/0/physics_layer_0/angular_velocity = 0.0 +4:11/0 = 0 +4:11/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:11/0/physics_layer_0/angular_velocity = 0.0 +5:11/0 = 0 +5:11/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:11/0/physics_layer_0/angular_velocity = 0.0 +6:11/0 = 0 +6:11/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:11/0/physics_layer_0/angular_velocity = 0.0 +7:11/0 = 0 +7:11/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:11/0/physics_layer_0/angular_velocity = 0.0 +8:11/0 = 0 +8:11/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:11/0/physics_layer_0/angular_velocity = 0.0 +9:11/0 = 0 +9:11/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:11/0/physics_layer_0/angular_velocity = 0.0 +10:11/0 = 0 +10:11/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:11/0/physics_layer_0/angular_velocity = 0.0 +11:11/0 = 0 +11:11/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:11/0/physics_layer_0/angular_velocity = 0.0 +12:11/0 = 0 +12:11/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:11/0/physics_layer_0/angular_velocity = 0.0 +13:11/0 = 0 +13:11/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:11/0/physics_layer_0/angular_velocity = 0.0 +14:11/0 = 0 +14:11/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:11/0/physics_layer_0/angular_velocity = 0.0 +0:12/0 = 0 +0:12/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:12/0/physics_layer_0/angular_velocity = 0.0 +1:12/0 = 0 +1:12/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:12/0/physics_layer_0/angular_velocity = 0.0 +2:12/0 = 0 +2:12/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:12/0/physics_layer_0/angular_velocity = 0.0 +3:12/0 = 0 +3:12/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:12/0/physics_layer_0/angular_velocity = 0.0 +4:12/0 = 0 +4:12/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:12/0/physics_layer_0/angular_velocity = 0.0 +5:12/0 = 0 +5:12/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:12/0/physics_layer_0/angular_velocity = 0.0 +6:12/0 = 0 +6:12/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:12/0/physics_layer_0/angular_velocity = 0.0 +7:12/0 = 0 +7:12/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:12/0/physics_layer_0/angular_velocity = 0.0 +8:12/0 = 0 +8:12/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:12/0/physics_layer_0/angular_velocity = 0.0 +9:12/0 = 0 +9:12/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:12/0/physics_layer_0/angular_velocity = 0.0 +10:12/0 = 0 +10:12/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:12/0/physics_layer_0/angular_velocity = 0.0 +11:12/0 = 0 +11:12/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:12/0/physics_layer_0/angular_velocity = 0.0 +12:12/0 = 0 +12:12/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:12/0/physics_layer_0/angular_velocity = 0.0 +13:12/0 = 0 +13:12/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:12/0/physics_layer_0/angular_velocity = 0.0 +14:12/0 = 0 +14:12/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:12/0/physics_layer_0/angular_velocity = 0.0 +0:13/0 = 0 +0:13/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:13/0/physics_layer_0/angular_velocity = 0.0 +1:13/0 = 0 +1:13/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:13/0/physics_layer_0/angular_velocity = 0.0 +2:13/0 = 0 +2:13/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:13/0/physics_layer_0/angular_velocity = 0.0 +3:13/0 = 0 +3:13/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:13/0/physics_layer_0/angular_velocity = 0.0 +9:13/0 = 0 +9:13/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:13/0/physics_layer_0/angular_velocity = 0.0 +10:13/0 = 0 +10:13/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:13/0/physics_layer_0/angular_velocity = 0.0 +11:13/0 = 0 +11:13/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:13/0/physics_layer_0/angular_velocity = 0.0 +12:13/0 = 0 +12:13/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:13/0/physics_layer_0/angular_velocity = 0.0 +13:13/0 = 0 +13:13/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:13/0/physics_layer_0/angular_velocity = 0.0 +14:13/0 = 0 +14:13/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:13/0/physics_layer_0/angular_velocity = 0.0 +0:14/0 = 0 +0:14/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:14/0/physics_layer_0/angular_velocity = 0.0 +1:14/0 = 0 +1:14/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:14/0/physics_layer_0/angular_velocity = 0.0 +2:14/0 = 0 +2:14/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:14/0/physics_layer_0/angular_velocity = 0.0 +3:14/0 = 0 +3:14/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:14/0/physics_layer_0/angular_velocity = 0.0 +4:14/0 = 0 +4:14/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:14/0/physics_layer_0/angular_velocity = 0.0 +5:14/0 = 0 +5:14/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:14/0/physics_layer_0/angular_velocity = 0.0 +6:14/0 = 0 +6:14/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:14/0/physics_layer_0/angular_velocity = 0.0 +7:14/0 = 0 +7:14/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:14/0/physics_layer_0/angular_velocity = 0.0 +8:14/0 = 0 +8:14/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:14/0/physics_layer_0/angular_velocity = 0.0 +9:14/0 = 0 +9:14/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:14/0/physics_layer_0/angular_velocity = 0.0 +10:14/0 = 0 +10:14/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:14/0/physics_layer_0/angular_velocity = 0.0 +11:14/0 = 0 +11:14/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:14/0/physics_layer_0/angular_velocity = 0.0 +12:14/0 = 0 +12:14/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:14/0/physics_layer_0/angular_velocity = 0.0 +13:14/0 = 0 +13:14/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:14/0/physics_layer_0/angular_velocity = 0.0 +14:14/0 = 0 +14:14/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:14/0/physics_layer_0/angular_velocity = 0.0 +0:15/0 = 0 +0:15/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:15/0/physics_layer_0/angular_velocity = 0.0 +1:15/0 = 0 +1:15/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:15/0/physics_layer_0/angular_velocity = 0.0 +2:15/0 = 0 +2:15/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:15/0/physics_layer_0/angular_velocity = 0.0 +3:15/0 = 0 +3:15/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:15/0/physics_layer_0/angular_velocity = 0.0 +4:15/0 = 0 +4:15/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:15/0/physics_layer_0/angular_velocity = 0.0 +5:15/0 = 0 +5:15/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:15/0/physics_layer_0/angular_velocity = 0.0 +6:15/0 = 0 +6:15/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:15/0/physics_layer_0/angular_velocity = 0.0 +7:15/0 = 0 +7:15/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:15/0/physics_layer_0/angular_velocity = 0.0 +8:15/0 = 0 +8:15/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:15/0/physics_layer_0/angular_velocity = 0.0 +9:15/0 = 0 +9:15/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:15/0/physics_layer_0/angular_velocity = 0.0 +10:15/0 = 0 +10:15/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:15/0/physics_layer_0/angular_velocity = 0.0 +11:15/0 = 0 +11:15/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:15/0/physics_layer_0/angular_velocity = 0.0 +12:15/0 = 0 +12:15/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:15/0/physics_layer_0/angular_velocity = 0.0 +13:15/0 = 0 +13:15/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:15/0/physics_layer_0/angular_velocity = 0.0 +14:15/0 = 0 +14:15/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:15/0/physics_layer_0/angular_velocity = 0.0 +0:16/0 = 0 +0:16/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:16/0/physics_layer_0/angular_velocity = 0.0 +1:16/0 = 0 +1:16/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:16/0/physics_layer_0/angular_velocity = 0.0 +2:16/0 = 0 +2:16/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:16/0/physics_layer_0/angular_velocity = 0.0 +3:16/0 = 0 +3:16/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:16/0/physics_layer_0/angular_velocity = 0.0 +4:16/0 = 0 +4:16/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:16/0/physics_layer_0/angular_velocity = 0.0 +5:16/0 = 0 +5:16/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:16/0/physics_layer_0/angular_velocity = 0.0 +6:16/0 = 0 +6:16/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:16/0/physics_layer_0/angular_velocity = 0.0 +7:16/0 = 0 +7:16/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:16/0/physics_layer_0/angular_velocity = 0.0 +8:16/0 = 0 +8:16/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:16/0/physics_layer_0/angular_velocity = 0.0 +9:16/0 = 0 +9:16/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:16/0/physics_layer_0/angular_velocity = 0.0 +10:16/0 = 0 +10:16/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:16/0/physics_layer_0/angular_velocity = 0.0 +11:16/0 = 0 +11:16/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:16/0/physics_layer_0/angular_velocity = 0.0 +12:16/0 = 0 +12:16/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:16/0/physics_layer_0/angular_velocity = 0.0 +13:16/0 = 0 +13:16/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:16/0/physics_layer_0/angular_velocity = 0.0 +14:16/0 = 0 +14:16/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:16/0/physics_layer_0/angular_velocity = 0.0 +0:17/0 = 0 +0:17/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:17/0/physics_layer_0/angular_velocity = 0.0 +1:17/0 = 0 +1:17/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:17/0/physics_layer_0/angular_velocity = 0.0 +2:17/0 = 0 +2:17/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:17/0/physics_layer_0/angular_velocity = 0.0 +3:17/0 = 0 +3:17/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:17/0/physics_layer_0/angular_velocity = 0.0 +4:17/0 = 0 +4:17/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:17/0/physics_layer_0/angular_velocity = 0.0 +5:17/0 = 0 +5:17/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:17/0/physics_layer_0/angular_velocity = 0.0 +6:17/0 = 0 +6:17/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:17/0/physics_layer_0/angular_velocity = 0.0 +7:17/0 = 0 +7:17/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:17/0/physics_layer_0/angular_velocity = 0.0 +8:17/0 = 0 +8:17/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:17/0/physics_layer_0/angular_velocity = 0.0 +9:17/0 = 0 +9:17/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:17/0/physics_layer_0/angular_velocity = 0.0 +10:17/0 = 0 +10:17/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:17/0/physics_layer_0/angular_velocity = 0.0 +10:17/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +11:17/0 = 0 +11:17/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:17/0/physics_layer_0/angular_velocity = 0.0 +12:17/0 = 0 +12:17/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:17/0/physics_layer_0/angular_velocity = 0.0 +13:17/0 = 0 +13:17/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:17/0/physics_layer_0/angular_velocity = 0.0 +14:17/0 = 0 +14:17/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:17/0/physics_layer_0/angular_velocity = 0.0 +0:18/0 = 0 +0:18/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:18/0/physics_layer_0/angular_velocity = 0.0 +1:18/0 = 0 +1:18/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:18/0/physics_layer_0/angular_velocity = 0.0 +2:18/0 = 0 +2:18/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:18/0/physics_layer_0/angular_velocity = 0.0 +3:18/0 = 0 +3:18/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:18/0/physics_layer_0/angular_velocity = 0.0 +4:18/0 = 0 +4:18/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:18/0/physics_layer_0/angular_velocity = 0.0 +5:18/0 = 0 +5:18/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:18/0/physics_layer_0/angular_velocity = 0.0 +6:18/0 = 0 +6:18/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:18/0/physics_layer_0/angular_velocity = 0.0 +7:18/0 = 0 +7:18/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:18/0/physics_layer_0/angular_velocity = 0.0 +8:18/0 = 0 +8:18/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:18/0/physics_layer_0/angular_velocity = 0.0 +9:18/0 = 0 +9:18/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:18/0/physics_layer_0/angular_velocity = 0.0 +10:18/0 = 0 +10:18/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:18/0/physics_layer_0/angular_velocity = 0.0 +10:18/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +11:18/0 = 0 +11:18/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:18/0/physics_layer_0/angular_velocity = 0.0 +12:18/0 = 0 +12:18/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:18/0/physics_layer_0/angular_velocity = 0.0 +13:18/0 = 0 +13:18/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:18/0/physics_layer_0/angular_velocity = 0.0 +14:18/0 = 0 +14:18/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:18/0/physics_layer_0/angular_velocity = 0.0 + +[sub_resource type="TileSetScenesCollectionSource" id="TileSetScenesCollectionSource_wx4m1"] +scenes/1/scene = ExtResource("1_fy8qx") + +[sub_resource type="TileSet" id="TileSet_x3dvd"] +physics_layer_0/collision_layer = 8 +physics_layer_0/collision_mask = 0 +sources/1 = SubResource("TileSetAtlasSource_gfeqr") +sources/2 = SubResource("TileSetScenesCollectionSource_wx4m1") + +[node name="TileMap" type="TileMap"] +process_mode = 4 +z_index = -1 +tile_set = SubResource("TileSet_x3dvd") +format = 2 +layer_1/name = "Breakables" +layer_1/enabled = true +layer_1/modulate = Color(1, 1, 1, 1) +layer_1/y_sort_enabled = false +layer_1/y_sort_origin = 0 +layer_1/z_index = 1 +layer_1/tile_data = PackedInt32Array() +script = ExtResource("3_e12vf") diff --git a/Scenes/Entities/Bombs/Bomb.gd b/Scenes/Entities/Bombs/Bomb.gd new file mode 100644 index 0000000..96a5e62 --- /dev/null +++ b/Scenes/Entities/Bombs/Bomb.gd @@ -0,0 +1,165 @@ +extends CharacterBody2D + +class_name Bomb + + +signal body_exited +signal exploded + + +var Explosion = preload("res://Scenes/Entities/Bombs/Explosion.tscn") +var power = 2 + + +func _ready(): + add_to_group("bombs") + + var collision_area = Utilities.Collision.Area.new(self, $CollisionShape2D) + collision_area.connect("collided", Callable(self, "_collide")) + collision_area.connect("body_exited", Callable(self, "_body_exited")) + add_child(collision_area) + + $AnimatedSprite2D.play() + + +func _process(delta): + var collision = move_and_collide(velocity * delta) + if collision: + velocity = Vector2(0, 0) + + +func explode(): + $CollisionShape2D.disabled = true + + # explode on the spot + var explosion = self.spawn_explosion(self.global_position) + + # explode in all directions + var directions = [ + Vector2.UP, + Vector2.RIGHT, + Vector2.DOWN, + Vector2.LEFT, + ] + + for j in range(directions.size()): + var direction = directions[j] + + for i in range(self.get_power()): + var to = Utilities.from_grid_to_position( + Utilities.from_position_to_grid(self.global_position) + (direction * (i + 1)) + ) + + var query = PhysicsPointQueryParameters2D.new() + query.set_position(to) + query.set_collision_mask(explosion.collision_mask) + + var explosion_intersection = get_world_2d().direct_space_state.intersect_point(query) + if explosion_intersection: + var collider = explosion_intersection[0].collider + + # call collision function and get collision type + var collision_type + if collider.is_in_group("player"): + collision_type = self._on_collide_group_player() + elif collider.is_in_group("enemies"): + collision_type = self._on_collide_group_enemies() + elif collider.is_in_group("explosions"): + collision_type = self._on_collide_group_explosions() + elif collider.is_in_group("bombs"): + collision_type = self._on_collide_group_bombs() + elif collider.is_in_group("breakables"): + collision_type = self._on_collide_group_breakables() + else: + collision_type = self._on_collide_group_else() + + # progress loop based on collision type + if collision_type == EXPLOSION_COLLISION_TYPE.STOP: + break + if collision_type == EXPLOSION_COLLISION_TYPE.SPAWN_AND_STOP: + self.spawn_explosion(to) + break + elif collision_type == EXPLOSION_COLLISION_TYPE.SKIP: + continue + elif collision_type == EXPLOSION_COLLISION_TYPE.CONTINUE: + pass + elif collision_type == EXPLOSION_COLLISION_TYPE.HIT_STOP: + if collider.has_method("hit_by_explosion"): + collider.hit_by_explosion() + break + elif collision_type == EXPLOSION_COLLISION_TYPE.HIT_CONTINUE: + if collider.has_method("hit_by_explosion"): + collider.hit_by_explosion() + continue + + self.spawn_explosion(to) + + emit_signal("exploded", self) + + queue_free() + + +func get_power(): + return self.power + + +func spawn_explosion(spawn_position: Vector2): + var explosion = Explosion.instantiate() + explosion.position = spawn_position + get_tree().get_current_scene().add_child(explosion) + + return explosion + + +func hit_by_explosion(): + call_deferred("explode") + + +func _collide(area: Area2D): + if area.is_in_group("explosions"): + call_deferred("explode") + + +func _on_Timer_timeout(): + self.explode() + + +func _body_exited(body): + emit_signal("body_exited", body) + + +### Explosion Collision ### + + +enum EXPLOSION_COLLISION_TYPE { + STOP, + SKIP, + CONTINUE, + SPAWN_AND_STOP, + HIT_STOP, + HIT_CONTINUE, +} + + +func _on_collide_group_player(): + return EXPLOSION_COLLISION_TYPE.CONTINUE + + +func _on_collide_group_enemies(): + return EXPLOSION_COLLISION_TYPE.CONTINUE + + +func _on_collide_group_explosions(): + return EXPLOSION_COLLISION_TYPE.SKIP + + +func _on_collide_group_bombs(): + return EXPLOSION_COLLISION_TYPE.HIT_STOP + + +func _on_collide_group_breakables(): + return EXPLOSION_COLLISION_TYPE.HIT_STOP + + +func _on_collide_group_else(): + return EXPLOSION_COLLISION_TYPE.STOP diff --git a/Scenes/Entities/Bombs/Bomb__Breakables.gd b/Scenes/Entities/Bombs/Bomb__Breakables.gd new file mode 100644 index 0000000..177d86e --- /dev/null +++ b/Scenes/Entities/Bombs/Bomb__Breakables.gd @@ -0,0 +1,4 @@ +extends "res://Scenes/Entities/Bombs/Bomb.gd" + +func _on_collide_group_breakables(): + return EXPLOSION_COLLISION_TYPE.HIT_CONTINUE diff --git a/Scenes/Entities/Bombs/Bomb__Breakables.tscn b/Scenes/Entities/Bombs/Bomb__Breakables.tscn new file mode 100644 index 0000000..a4bb192 --- /dev/null +++ b/Scenes/Entities/Bombs/Bomb__Breakables.tscn @@ -0,0 +1,50 @@ +[gd_scene load_steps=7 format=3 uid="uid://bcdo4xwalfyw2"] + +[ext_resource type="Script" path="res://Scenes/Entities/Bombs/Bomb__Breakables.gd" id="1_53dqw"] +[ext_resource type="Texture2D" uid="uid://tb10jfeilqxk" path="res://Assets/16_bit_animated_bomb/16_bit_bomb3.png" id="2_xuubc"] +[ext_resource type="Texture2D" uid="uid://ptkpqpfgcoug" path="res://Assets/16_bit_animated_bomb/16bit_bomb1.png" id="3_3gndm"] +[ext_resource type="Texture2D" uid="uid://dsomaiq14ajhf" path="res://Assets/16_bit_animated_bomb/16_bit_bomb2.png" id="4_u38sl"] + +[sub_resource type="CircleShape2D" id="1"] +radius = 7.9 + +[sub_resource type="SpriteFrames" id="2"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("2_xuubc") +}, { +"duration": 1.0, +"texture": ExtResource("3_3gndm") +}, { +"duration": 1.0, +"texture": ExtResource("4_u38sl") +}, { +"duration": 1.0, +"texture": ExtResource("2_xuubc") +}], +"loop": false, +"name": &"default", +"speed": 1.0 +}] + +[node name="Bomb__Breakables" type="CharacterBody2D"] +collision_layer = 4 +collision_mask = 62 +script = ExtResource("1_53dqw") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("1") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +modulate = Color(1, 0, 0, 1) +position = Vector2(1, -1) +scale = Vector2(1.23978, 1.23978) +sprite_frames = SubResource("2") + +[node name="Timer" type="Timer" parent="."] +wait_time = 4.0 +one_shot = true +autostart = true + +[connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"] diff --git a/Scenes/Entities/Bombs/Bomb__Normal.gd b/Scenes/Entities/Bombs/Bomb__Normal.gd new file mode 100644 index 0000000..2c89be6 --- /dev/null +++ b/Scenes/Entities/Bombs/Bomb__Normal.gd @@ -0,0 +1 @@ +extends "res://Scenes/Entities/Bombs/Bomb.gd" diff --git a/Scenes/Entities/Bombs/Bomb__Normal.tscn b/Scenes/Entities/Bombs/Bomb__Normal.tscn new file mode 100644 index 0000000..011c298 --- /dev/null +++ b/Scenes/Entities/Bombs/Bomb__Normal.tscn @@ -0,0 +1,49 @@ +[gd_scene load_steps=7 format=3 uid="uid://elsifewesoyx"] + +[ext_resource type="Script" path="res://Scenes/Entities/Bombs/Bomb__Normal.gd" id="1_3o4t3"] +[ext_resource type="Texture2D" uid="uid://tb10jfeilqxk" path="res://Assets/16_bit_animated_bomb/16_bit_bomb3.png" id="2_qio5f"] +[ext_resource type="Texture2D" uid="uid://ptkpqpfgcoug" path="res://Assets/16_bit_animated_bomb/16bit_bomb1.png" id="3_nom56"] +[ext_resource type="Texture2D" uid="uid://dsomaiq14ajhf" path="res://Assets/16_bit_animated_bomb/16_bit_bomb2.png" id="4_xndnu"] + +[sub_resource type="CircleShape2D" id="1"] +radius = 7.9 + +[sub_resource type="SpriteFrames" id="2"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("2_qio5f") +}, { +"duration": 1.0, +"texture": ExtResource("3_nom56") +}, { +"duration": 1.0, +"texture": ExtResource("4_xndnu") +}, { +"duration": 1.0, +"texture": ExtResource("2_qio5f") +}], +"loop": false, +"name": &"default", +"speed": 1.0 +}] + +[node name="Bomb__Normal" type="CharacterBody2D"] +collision_layer = 4 +collision_mask = 62 +script = ExtResource("1_3o4t3") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("1") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +position = Vector2(1, -1) +scale = Vector2(1.23978, 1.23978) +sprite_frames = SubResource("2") + +[node name="Timer" type="Timer" parent="."] +wait_time = 4.0 +one_shot = true +autostart = true + +[connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"] diff --git a/Scenes/Entities/Bombs/Explosion.gd b/Scenes/Entities/Bombs/Explosion.gd new file mode 100644 index 0000000..eba8b29 --- /dev/null +++ b/Scenes/Entities/Bombs/Explosion.gd @@ -0,0 +1,11 @@ +extends Area2D + + +func _ready(): + add_to_group("explosions") + + $AnimatedSprite2D.play() + + +func _on_AnimatedSprite_animation_finished(): + queue_free() diff --git a/Scenes/Entities/Bombs/Explosion.tscn b/Scenes/Entities/Bombs/Explosion.tscn new file mode 100644 index 0000000..2521dfb --- /dev/null +++ b/Scenes/Entities/Bombs/Explosion.tscn @@ -0,0 +1,63 @@ +[gd_scene load_steps=8 format=3 uid="uid://c8cg25hagp4lj"] + +[ext_resource type="Texture2D" uid="uid://5dk0c1kpvdgs" path="res://Assets/bomb_party_v4.png" id="1"] +[ext_resource type="Script" path="res://Scenes/Entities/Bombs/Explosion.gd" id="2"] + +[sub_resource type="AtlasTexture" id="3"] +atlas = ExtResource("1") +region = Rect2(224, 288, 16, 16) + +[sub_resource type="AtlasTexture" id="4"] +atlas = ExtResource("1") +region = Rect2(224, 272, 16, 16) + +[sub_resource type="AtlasTexture" id="5"] +atlas = ExtResource("1") +region = Rect2(224, 256, 16, 16) + +[sub_resource type="SpriteFrames" id="1"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("3") +}, { +"duration": 1.0, +"texture": SubResource("3") +}, { +"duration": 1.0, +"texture": SubResource("4") +}, { +"duration": 1.0, +"texture": SubResource("4") +}, { +"duration": 1.0, +"texture": SubResource("4") +}, { +"duration": 1.0, +"texture": SubResource("5") +}, { +"duration": 1.0, +"texture": SubResource("5") +}], +"loop": false, +"name": &"default", +"speed": 60.0 +}] + +[sub_resource type="CircleShape2D" id="2"] +radius = 7.5 + +[node name="Explosion" type="Area2D"] +collision_layer = 32 +collision_mask = 62 +script = ExtResource("2") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +position = Vector2(-2.98023e-08, -2.98023e-08) +scale = Vector2(0.913346, 0.913346) +sprite_frames = SubResource("1") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("2") + +[connection signal="animation_finished" from="AnimatedSprite2D" to="." method="_on_AnimatedSprite_animation_finished"] diff --git a/Scenes/Entities/Enemies/Enemy.gd b/Scenes/Entities/Enemies/Enemy.gd new file mode 100644 index 0000000..5b72c04 --- /dev/null +++ b/Scenes/Entities/Enemies/Enemy.gd @@ -0,0 +1,81 @@ +extends CharacterBody2D + + +const SPEED = 30 + +const DIRECTIONS = [Vector2.UP, Vector2.RIGHT, Vector2.DOWN, Vector2.LEFT] +var CURRENT_DIRECTION = Vector2.UP + +@export var health: int = 4 + +var is_invincible = false + + +func _ready(): + add_to_group("enemies") + + var collision_area = Utilities.Collision.Area.new(self, $CollisionShape2D) + collision_area.connect("collided", Callable(self, "_collide")) + add_child(collision_area) + + $Label.text = str(self.health) + + +func _physics_process(delta): + if CURRENT_DIRECTION == Vector2.UP: + velocity.y -= SPEED + $AnimatedSprite2D.play("up") + elif CURRENT_DIRECTION == Vector2.DOWN: + velocity.y += SPEED + $AnimatedSprite2D.play("down") + elif CURRENT_DIRECTION == Vector2.LEFT: + velocity.x -= SPEED + $AnimatedSprite2D.flip_h = true + $AnimatedSprite2D.play("left") + elif CURRENT_DIRECTION == Vector2.RIGHT: + velocity.x += SPEED + $AnimatedSprite2D.flip_h = false + $AnimatedSprite2D.play("right") + + move_and_collide(velocity * delta) + velocity = velocity.lerp(Vector2(0, 0), 1) + + +func take_damage(amount): + if self.is_invincible: + return + + self.set_invincibility() + + self.health -= amount + + if self.health == 0: + queue_free() + + $Label.text = str(self.health) + + +func _collide(area: Area2D): + if area.is_in_group("explosions"): + self.take_damage(4) + + +func _on_movement_timer_timeout(): + var directions = self.DIRECTIONS.duplicate() + + directions.remove_at(directions.find(CURRENT_DIRECTION)) + directions.shuffle() + + CURRENT_DIRECTION = directions[0] + + $MovementTimer.start() + + +func set_invincibility(): + $InvincibilityTimer.start() + $AnimatedSprite2D.set_modulate(Color(10, 1, 1, 1)) + self.is_invincible = true + +func _on_invincibility_timer_timeout(): + $AnimatedSprite2D.set_modulate(Color(1, 1, 1, 1)) + self.is_invincible = false diff --git a/Scenes/Entities/Enemies/Enemy.tscn b/Scenes/Entities/Enemies/Enemy.tscn new file mode 100644 index 0000000..f78d0e5 --- /dev/null +++ b/Scenes/Entities/Enemies/Enemy.tscn @@ -0,0 +1,91 @@ +[gd_scene load_steps=9 format=3 uid="uid://dgyk1sged38ct"] + +[ext_resource type="Script" path="res://Scenes/Entities/Enemies/Enemy.gd" id="1_k16kd"] +[ext_resource type="Texture2D" uid="uid://5dk0c1kpvdgs" path="res://Assets/bomb_party_v4.png" id="2_cjc2s"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_gw5gm"] +size = Vector2(11, 11.5) + +[sub_resource type="AtlasTexture" id="AtlasTexture_t7fm8"] +atlas = ExtResource("2_cjc2s") +region = Rect2(16, 224, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_pyhot"] +atlas = ExtResource("2_cjc2s") +region = Rect2(64, 224, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_aj58r"] +atlas = ExtResource("2_cjc2s") +region = Rect2(64, 224, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_spvfr"] +atlas = ExtResource("2_cjc2s") +region = Rect2(0, 224, 16, 16) + +[sub_resource type="SpriteFrames" id="SpriteFrames_t5cld"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_t7fm8") +}], +"loop": true, +"name": &"down", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_pyhot") +}], +"loop": true, +"name": &"left", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_aj58r") +}], +"loop": true, +"name": &"right", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_spvfr") +}], +"loop": true, +"name": &"up", +"speed": 5.0 +}] + +[node name="Enemy" type="CharacterBody2D"] +collision_layer = 16 +collision_mask = 62 +script = ExtResource("1_k16kd") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2(0.5, -0.25) +shape = SubResource("RectangleShape2D_gw5gm") +metadata/_edit_lock_ = true + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +sprite_frames = SubResource("SpriteFrames_t5cld") +animation = &"down" + +[node name="Label" type="Label" parent="."] +offset_left = -5.0 +offset_top = -20.0 +offset_right = 16.0 +offset_bottom = 6.0 +scale = Vector2(0.5, 0.5) +text = "hp" + +[node name="MovementTimer" type="Timer" parent="."] +wait_time = 3.0 +autostart = true + +[node name="InvincibilityTimer" type="Timer" parent="."] +wait_time = 1.5 +one_shot = true + +[connection signal="timeout" from="MovementTimer" to="." method="_on_movement_timer_timeout"] +[connection signal="timeout" from="InvincibilityTimer" to="." method="_on_invincibility_timer_timeout"] diff --git a/Scenes/Entities/Objects/Box.gd b/Scenes/Entities/Objects/Box.gd new file mode 100644 index 0000000..c7b7d4e --- /dev/null +++ b/Scenes/Entities/Objects/Box.gd @@ -0,0 +1,28 @@ +extends StaticBody2D + + +func _ready(): + var collision_area = Utilities.Collision.Area.new(self, $CollisionShape2D, false) + collision_area.connect("collided", Callable(self, "_collide")) + add_child(collision_area) + + +func hit_by_explosion(): + $AnimationPlayer.play("breaking") + await $AnimationPlayer.animation_finished + + if randi_range(1, 3) == 1: + call_deferred("spawn_coin") + + queue_free() + + +func spawn_coin(): + var coin = preload("res://Scenes/Entities/Objects/Coin.tscn").instantiate() + coin.position = self.position + get_tree().get_current_scene().add_child(coin) + + +func _collide(area: Area2D): + if area.is_in_group("explosions"): + self.hit_by_explosion() diff --git a/Scenes/Entities/Objects/Box.tscn b/Scenes/Entities/Objects/Box.tscn new file mode 100644 index 0000000..6acb93f --- /dev/null +++ b/Scenes/Entities/Objects/Box.tscn @@ -0,0 +1,106 @@ +[gd_scene load_steps=7 format=3 uid="uid://bugyo0c505kdw"] + +[ext_resource type="Script" path="res://Scenes/Entities/Objects/Box.gd" id="1_owgyi"] +[ext_resource type="Texture2D" uid="uid://5dk0c1kpvdgs" path="res://Assets/bomb_party_v4.png" id="1_yqw0v"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_rwppg"] +size = Vector2(16, 16) + +[sub_resource type="Animation" id="Animation_ihbs5"] +resource_name = "breaking" +length = 0.2 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Sprite2D:modulate") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.1, 0.2), +"transitions": PackedFloat32Array(1, 1, 1), +"update": 0, +"values": [Color(1, 1, 1, 1), Color(1, 1, 0, 1), Color(1, 0, 0, 1)] +} + +[sub_resource type="Animation" id="Animation_5u23n"] +length = 0.001 +tracks/0/type = "bezier" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Sprite2D:modulate:r") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"handle_modes": PackedInt32Array(0), +"points": PackedFloat32Array(1, -0.25, 0, 0.25, 0), +"times": PackedFloat32Array(0) +} +tracks/1/type = "bezier" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("Sprite2D:modulate:g") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"handle_modes": PackedInt32Array(0), +"points": PackedFloat32Array(1, -0.25, 0, 0.25, 0), +"times": PackedFloat32Array(0) +} +tracks/2/type = "bezier" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("Sprite2D:modulate:b") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"handle_modes": PackedInt32Array(0), +"points": PackedFloat32Array(1, -0.25, 0, 0.25, 0), +"times": PackedFloat32Array(0) +} +tracks/3/type = "bezier" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath("Sprite2D:modulate:a") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"handle_modes": PackedInt32Array(0), +"points": PackedFloat32Array(1, -0.25, 0, 0.25, 0), +"times": PackedFloat32Array(0) +} +tracks/4/type = "value" +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/path = NodePath("Sprite2D:modulate") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Color(1, 1, 0, 1)] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_cqvgo"] +_data = { +"RESET": SubResource("Animation_5u23n"), +"breaking": SubResource("Animation_ihbs5") +} + +[node name="Box" type="StaticBody2D" groups=["breakables"]] +collision_layer = 8 +collision_mask = 32 +script = ExtResource("1_owgyi") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("RectangleShape2D_rwppg") + +[node name="Sprite2D" type="Sprite2D" parent="."] +texture = ExtResource("1_yqw0v") +region_enabled = true +region_rect = Rect2(144.052, 208.08, 16, 16) + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +libraries = { +"": SubResource("AnimationLibrary_cqvgo") +} diff --git a/Scenes/Entities/Objects/Coin.gd b/Scenes/Entities/Objects/Coin.gd new file mode 100644 index 0000000..77fc6c2 --- /dev/null +++ b/Scenes/Entities/Objects/Coin.gd @@ -0,0 +1,16 @@ +extends StaticBody2D + + +func _ready(): + var collision_area = Utilities.Collision.Area.new(self, $CollisionShape2D, false) + collision_area.connect("collided", Callable(self, "_collide")) + add_child(collision_area) + + +func hit_by_explosion(): + queue_free() + + +func _collide(area: Area2D): + if area.is_in_group("player"): + queue_free() diff --git a/Scenes/Entities/Objects/Coin.tscn b/Scenes/Entities/Objects/Coin.tscn new file mode 100644 index 0000000..aacb70b --- /dev/null +++ b/Scenes/Entities/Objects/Coin.tscn @@ -0,0 +1,21 @@ +[gd_scene load_steps=4 format=3 uid="uid://cl7jri45a43t0"] + +[ext_resource type="Script" path="res://Scenes/Entities/Objects/Coin.gd" id="1_kjrye"] +[ext_resource type="Texture2D" uid="uid://5dk0c1kpvdgs" path="res://Assets/bomb_party_v4.png" id="2_0mghm"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_rwppg"] +size = Vector2(16, 16) + +[node name="Coin" type="StaticBody2D" groups=["breakables"]] +collision_layer = 8 +collision_mask = 34 +script = ExtResource("1_kjrye") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("RectangleShape2D_rwppg") + +[node name="Sprite2D" type="Sprite2D" parent="."] +self_modulate = Color(1, 0, 1, 1) +texture = ExtResource("2_0mghm") +region_enabled = true +region_rect = Rect2(48.8626, 208.456, 15.1374, 15.5442) diff --git a/Scenes/Entities/Player.gd b/Scenes/Entities/Player.gd new file mode 100644 index 0000000..a578bbb --- /dev/null +++ b/Scenes/Entities/Player.gd @@ -0,0 +1,202 @@ +extends CharacterBody2D + +class_name Player + + +signal damaged + + +const SPEED = 60 +const KICK_SPEED = 300 +const THROW_DISTANCE = 3 + +@export var Bomb: PackedScene = preload("res://Scenes/Entities/Bombs/Bomb__Normal.tscn") +@export var bomb_power: int = 2 + +@export var maxHealth: int = 12 +@export var health: int = self.maxHealth +@export var extraHealth: int = 5 + +var is_invincible = false + +var held_bomb: Bomb + +var DIRECTION = Vector2.DOWN + +var collision_area: Area2D + + + +func _ready(): + add_to_group("player") + set_up_direction(Vector2.UP) + motion_mode = CharacterBody2D.MOTION_MODE_FLOATING + + collision_area = Utilities.Collision.Area.new(self, $CollisionShape2D) + collision_area.connect("collided", Callable(self, "_collide")) + add_child(collision_area) + + +func _process(delta): + if Input.is_action_pressed("ui_left"): + velocity.x -= SPEED + $AnimatedSprite2D.play("left") + self.DIRECTION = Vector2.LEFT + if Input.is_action_pressed("ui_right"): + velocity.x += SPEED + $AnimatedSprite2D.play("right") + self.DIRECTION = Vector2.RIGHT + if Input.is_action_pressed("ui_up"): + velocity.y -= SPEED + $AnimatedSprite2D.play("up") + self.DIRECTION = Vector2.UP + if Input.is_action_pressed("ui_down"): + velocity.y += SPEED + $AnimatedSprite2D.play("down") + self.DIRECTION = Vector2.DOWN + + if velocity.x < 0 && velocity.y < 0: + $AnimatedSprite2D.play("tl") + elif velocity.x > 0 && velocity.y < 0: + $AnimatedSprite2D.play("tr") + elif velocity.x < 0 && velocity.y > 0: + $AnimatedSprite2D.play("bl") + elif velocity.x > 0 && velocity.y > 0: + $AnimatedSprite2D.play("br") + + if Input.is_action_just_pressed("ui_accept"): + if self.held_bomb: + self.throw_bomb() + else: + var interacted = false + var areas = $InteractionArea.get_overlapping_areas() + for area in areas: + if area.is_in_group("bombs"): + var bomb = area.get_parent() + self.pick_up_bomb(bomb) + + interacted = true + break + + if not interacted: + self.plant_bomb() + + self.collide(move_and_collide(velocity * delta)) + velocity = velocity.lerp(Vector2(0, 0), 1) + + +func plant_bomb(): + var bomb = Bomb.instantiate() + bomb.position = Utilities.get_level_position_grid(self) + bomb.power = self.bomb_power + + self.add_collision_exception_with(bomb) + bomb.connect("body_exited", func(body): + if body.is_in_group("player") and not self.held_bomb: + self.remove_collision_exception_with(bomb) + ) + + get_tree().get_current_scene().add_child(bomb) + + +func pick_up_bomb(bomb: Bomb): + get_tree().get_current_scene().remove_child(bomb) + bomb.position = Vector2(0, 0) + bomb.set_collision_layer_value(Utilities.Collision.Layer.BOMB, false) + self.add_collision_exception_with(bomb) + self.add_child(bomb) + + self.held_bomb = bomb + bomb.connect("exploded", func(bomb): + if self.held_bomb == bomb: + self.held_bomb = null + ) + + +func throw_bomb(): + var bomb = self.held_bomb + + self.remove_child(bomb) + + var target_position = null + var target_intersection = true + var additional_distance = 0 + while target_intersection: + target_position = Utilities.from_grid_to_position( + Utilities.from_position_to_grid(self.position) + ((self.THROW_DISTANCE + additional_distance) * self.DIRECTION) + ) + + var query = PhysicsPointQueryParameters2D.new() + query.set_position(target_position) + target_intersection = get_world_2d().direct_space_state.intersect_point(query) + + additional_distance += 1 + + bomb.position = target_position + + get_tree().get_current_scene().add_child(bomb) + + bomb.set_collision_layer_value(Utilities.Collision.Layer.BOMB, true) + (func(): self.remove_collision_exception_with(bomb)).call_deferred() + + self.held_bomb = null + + +func collide(collision: KinematicCollision2D): + if not collision: + return + + var collider = collision.get_collider() + + if collider.is_in_group("bombs"): + self.kick_bomb(collider) + + +func kick_bomb(bomb): + var diff = Utilities.get_level_position(self) - Utilities.get_level_position(bomb) + if diff.x > 0: + bomb.velocity.x -= KICK_SPEED + elif diff.x < 0: + bomb.velocity.x += KICK_SPEED + elif diff.y > 0: + bomb.velocity.y -= KICK_SPEED + elif diff.y < 0: + bomb.velocity.y += KICK_SPEED + + +func take_damage(amount): + if self.held_bomb: + self.held_bomb.call_deferred("explode") + + if self.is_invincible: + return + + self.set_invincibility() + + if self.extraHealth > 0: + if amount > self.extraHealth: + self.health -= amount - self.extraHealth + self.extraHealth = 0 + else: + self.extraHealth -= amount + else: + self.health -= amount + + self.emit_signal("damaged", self.health) + + +func set_invincibility(): + $Invincibility.start() + $AnimatedSprite2D.set_modulate(Color(10, 10, 10, 1)) + self.is_invincible = true + +func _on_invincibility_timeout(): + $AnimatedSprite2D.set_modulate(Color(1, 1, 1, 1)) + self.is_invincible = false + + +func _collide(area: Area2D): + if area.is_in_group("explosions"): + self.take_damage(2) + elif area.is_in_group("enemies"): + self.take_damage(1) diff --git a/Scenes/Entities/Player.tscn b/Scenes/Entities/Player.tscn new file mode 100644 index 0000000..f4ef6ab --- /dev/null +++ b/Scenes/Entities/Player.tscn @@ -0,0 +1,118 @@ +[gd_scene load_steps=13 format=3 uid="uid://b1xhgqwrw4pgs"] + +[ext_resource type="Texture2D" uid="uid://dtvvpqc7i2dm6" path="res://Assets/tux/signal-2021-05-05-214118_001.png" id="1"] +[ext_resource type="Script" path="res://Scenes/Entities/Player.gd" id="1_2xulf"] +[ext_resource type="Texture2D" uid="uid://o7x47dkwao04" path="res://Assets/tux/signal-2021-05-05-214118_002.png" id="2"] +[ext_resource type="Texture2D" uid="uid://4lhw1rn7w1ye" path="res://Assets/tux/signal-2021-05-05-214118_003.png" id="3"] +[ext_resource type="Texture2D" uid="uid://d354aghbycxto" path="res://Assets/tux/signal-2021-05-05-214118_004.png" id="4"] +[ext_resource type="Texture2D" uid="uid://3jnv1c847c3" path="res://Assets/tux/signal-2021-05-06-203546_001.png" id="5"] +[ext_resource type="Texture2D" uid="uid://c3o4wky2ywpng" path="res://Assets/tux/signal-2021-05-06-203546_004.png" id="6"] +[ext_resource type="Texture2D" uid="uid://b5v0jg6lwnij2" path="res://Assets/tux/signal-2021-05-06-203546_003.png" id="7"] +[ext_resource type="Texture2D" uid="uid://cnxxo0qivbv4c" path="res://Assets/tux/signal-2021-05-06-203546_002.png" id="7_bxbay"] + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_xsiww"] +radius = 5.0 +height = 14.0 + +[sub_resource type="SpriteFrames" id="2"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("7") +}], +"loop": true, +"name": &"bl", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": ExtResource("6") +}], +"loop": true, +"name": &"br", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": ExtResource("3") +}], +"loop": true, +"name": &"down", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": ExtResource("4") +}], +"loop": true, +"name": &"left", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": ExtResource("1") +}], +"loop": true, +"name": &"right", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": ExtResource("7_bxbay") +}], +"loop": true, +"name": &"tl", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": ExtResource("5") +}], +"loop": true, +"name": &"tr", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": ExtResource("2") +}], +"loop": true, +"name": &"up", +"speed": 5.0 +}] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_c6666"] +size = Vector2(14, 14) + +[node name="Player" type="CharacterBody2D"] +collision_layer = 2 +collision_mask = 60 +script = ExtResource("1_2xulf") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("CapsuleShape2D_xsiww") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +position = Vector2(5.96046e-08, 5.96046e-08) +scale = Vector2(0.405234, 0.405234) +sprite_frames = SubResource("2") +animation = &"down" +metadata/_edit_lock_ = true + +[node name="Camera2D" type="Camera2D" parent="."] +drag_horizontal_enabled = true +drag_vertical_enabled = true + +[node name="InteractionArea" type="Area2D" parent="."] +collision_layer = 0 +collision_mask = 4 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="InteractionArea"] +position = Vector2(0, 1) +shape = SubResource("RectangleShape2D_c6666") + +[node name="Invincibility" type="Timer" parent="."] +wait_time = 1.5 +one_shot = true + +[connection signal="timeout" from="Invincibility" to="." method="_on_invincibility_timeout"] diff --git a/Scenes/Global.gd b/Scenes/Global.gd new file mode 100644 index 0000000..6fea884 --- /dev/null +++ b/Scenes/Global.gd @@ -0,0 +1,4 @@ +extends Node + +var player: Player +var last_area: Area2D diff --git a/Scenes/Maps/Map.gd b/Scenes/Maps/Map.gd new file mode 100644 index 0000000..4f57f0e --- /dev/null +++ b/Scenes/Maps/Map.gd @@ -0,0 +1,24 @@ +extends Node + +func _ready(): + self.add_hud() + self.add_menu() + + +func add_hud(): + var HUD = CanvasLayer.new() + + var PlayerHealth = preload("res://Scenes/UI/HealthBar.tscn").instantiate(); + HUD.add_child(PlayerHealth) + PlayerHealth.connect_to_player(Global.player) + + add_child(HUD) + + +func add_menu(): + var MenuLayer = CanvasLayer.new() + + var Menu = preload("res://Scenes/UI/Menu.tscn").instantiate() + MenuLayer.add_child(Menu) + + add_child(MenuLayer) diff --git a/Scenes/Maps/Room.tscn b/Scenes/Maps/Room.tscn new file mode 100644 index 0000000..c304ed6 --- /dev/null +++ b/Scenes/Maps/Room.tscn @@ -0,0 +1,18 @@ +[gd_scene load_steps=3 format=3 uid="uid://6u87w813e8va"] + +[ext_resource type="PackedScene" uid="uid://d0t04jox4oxsv" path="res://Scenes/Components/TileMap.tscn" id="1_p0ngs"] +[ext_resource type="PackedScene" uid="uid://c5ix2njry0181" path="res://Scenes/Components/SceneTransition.tscn" id="2_gy81g"] + +[node name="Room" type="Node2D"] + +[node name="TileMap" parent="." instance=ExtResource("1_p0ngs")] +layer_0/tile_data = PackedInt32Array(131072, 655361, 18, 196608, 655361, 18, 262144, 655361, 18, 327680, 655361, 18, 393216, 655361, 18, 589824, 655361, 18, 655360, 655361, 18, 131073, 65537, 13, 196609, 65537, 13, 262145, 65537, 13, 327681, 65537, 13, 393217, 65537, 13, 589825, 65537, 13, 655361, 65537, 13, 720897, 65537, 13, 786433, 65537, 13, 851969, 65537, 13, 917505, 65537, 13, 983041, 65537, 13, 1048577, 65537, 13, 1114113, 65537, 13, 1179649, 65537, 13, 1245185, 65537, 13, 1310721, 65537, 13, 1376257, 655361, 17, 131074, 65537, 13, 196610, 65537, 13, 262146, 65537, 13, 327682, 65537, 13, 393218, 65537, 13, 589826, 65537, 13, 655362, 65537, 13, 720898, 65537, 13, 786434, 65537, 13, 851970, 65537, 13, 917506, 65537, 13, 983042, 65537, 13, 1048578, 65537, 13, 1114114, 65537, 13, 1179650, 65537, 13, 1245186, 65537, 13, 1310722, 65537, 13, 1376258, 655361, 17, 131075, 65537, 13, 196611, 65537, 13, 262147, 65537, 13, 327683, 65537, 13, 393219, 65537, 13, 589827, 65537, 13, 655363, 65537, 13, 720899, 65537, 13, 786435, 65537, 13, 851971, 65537, 13, 917507, 65537, 13, 983043, 65537, 13, 1048579, 65537, 13, 1114115, 65537, 13, 1179651, 65537, 13, 1245187, 65537, 13, 1310723, 65537, 13, 1376259, 655361, 17, 131076, 65537, 13, 196612, 65537, 13, 262148, 65537, 13, 327684, 65537, 13, 393220, 65537, 13, 589828, 65537, 13, 655364, 65537, 13, 589829, 65537, 13, 655365, 65537, 13, 589830, 65537, 13, 655366, 65537, 13, 589831, 65537, 13, 655367, 65537, 13, 589832, 65537, 13, 655368, 65537, 13, 589833, 65537, 13, 655369, 65537, 13, 589834, 65537, 13, 655370, 65537, 13, 589835, 65537, 13, 655371, 65537, 13, 589836, 65537, 13, 655372, 65537, 13, 589837, 65537, 13, 655373, 65537, 13, 589838, 65537, 13, 655374, 65537, 13, 589839, 65537, 13, 655375, 65537, 13, 589840, 65537, 13, 655376, 65537, 13, 589841, 65537, 13, 655377, 65537, 13, 589842, 65537, 13, 655378, 65537, 13, 1376256, 655361, 17, 0, 655361, 18, 1, 655361, 17, 2, 655361, 17, 3, 655361, 17, 4, 655361, 17, 5, 655361, 17, 6, 655361, 17, 7, 655361, 17, 8, 655361, 17, 9, 655361, 17, 10, 655361, 17, 11, 655361, 17, 12, 655361, 17, 13, 655361, 17, 14, 655361, 17, 15, 655361, 17, 16, 655361, 17, 17, 655361, 17, 18, 655361, 17, 19, 655361, 17, 20, 655361, 17, 21, 655361, 17, 22, 655361, 17, 23, 655361, 18, 25, 655361, 18, 65561, 655361, 18, 131097, 655361, 18, 196633, 655361, 18, 262169, 655361, 18, 327705, 655361, 18, 393241, 655361, 18, 458777, 655361, 18, 524313, 655361, 18, 589849, 655361, 18, 655385, 655361, 18, 720921, 655361, 18, 786457, 655361, 18, 851993, 655361, 18, 917529, 655361, 18, 983065, 655361, 18, 1048601, 655361, 18, 1114137, 655361, 18, 1179673, 655361, 18, 1245209, 655361, 18, 1310745, 655361, 18, 1376281, 655361, 17, 1376280, 655361, 17, 1376279, 655361, 17, 1376278, 655361, 17, 1376277, 655361, 17, 1376276, 655361, 17, 1376275, 655361, 17, 1376274, 655361, 17, 1376273, 655361, 17, 1376272, 655361, 17, 1376271, 655361, 17, 1376270, 655361, 17, 1376269, 655361, 17, 1376268, 655361, 17, 1376267, 655361, 17, 1376266, 655361, 17, 1376265, 655361, 17, 1376264, 655361, 17, 1376263, 655361, 17, 1376262, 655361, 17, 1376261, 655361, 17, 1376260, 655361, 17, 1310720, 655361, 18, 1245184, 655361, 18, 1179648, 655361, 18, 1114112, 655361, 18, 1048576, 655361, 18, 983040, 655361, 18, 917504, 655361, 18, 851968, 655361, 18, 786432, 655361, 18, 720896, 655361, 18, 524288, 655361, 18, 458752, 655361, 18, 65536, 655361, 18, 65537, 65537, 13, 458753, 65537, 13, 524289, 65537, 13, 65538, 65537, 13, 458754, 65537, 13, 524290, 65537, 13, 65539, 65537, 13, 458755, 65537, 13, 524291, 65537, 13, 65540, 65537, 13, 458756, 65537, 13, 524292, 65537, 13, 720900, 65537, 13, 786436, 65537, 13, 851972, 65537, 13, 917508, 65537, 13, 983044, 65537, 13, 1048580, 65537, 13, 1114116, 65537, 13, 1179652, 65537, 13, 1245188, 65537, 13, 1310724, 65537, 13, 65541, 65537, 13, 131077, 65537, 13, 196613, 65537, 13, 262149, 65537, 13, 327685, 65537, 13, 393221, 65537, 13, 458757, 65537, 13, 524293, 65537, 13, 720901, 65537, 13, 786437, 65537, 13, 851973, 65537, 13, 917509, 65537, 13, 983045, 65537, 13, 1048581, 65537, 13, 1114117, 65537, 13, 1179653, 65537, 13, 1245189, 65537, 13, 1310725, 65537, 13, 65542, 65537, 13, 131078, 65537, 13, 196614, 65537, 13, 262150, 65537, 13, 327686, 65537, 13, 393222, 65537, 13, 458758, 65537, 13, 524294, 65537, 13, 720902, 65537, 13, 786438, 65537, 13, 851974, 65537, 13, 917510, 65537, 13, 983046, 65537, 13, 1048582, 65537, 13, 1114118, 65537, 13, 1179654, 65537, 13, 1245190, 65537, 13, 1310726, 65537, 13, 65543, 65537, 13, 131079, 65537, 13, 196615, 65537, 13, 262151, 65537, 13, 327687, 65537, 13, 393223, 65537, 13, 458759, 65537, 13, 524295, 65537, 13, 720903, 65537, 13, 786439, 65537, 13, 851975, 65537, 13, 917511, 65537, 13, 983047, 65537, 13, 1048583, 65537, 13, 1114119, 65537, 13, 1179655, 65537, 13, 1245191, 65537, 13, 1310727, 65537, 13, 65544, 65537, 13, 131080, 65537, 13, 196616, 65537, 13, 262152, 65537, 13, 327688, 65537, 13, 393224, 65537, 13, 458760, 65537, 13, 524296, 65537, 13, 720904, 65537, 13, 786440, 65537, 13, 851976, 65537, 13, 917512, 65537, 13, 983048, 65537, 13, 1048584, 65537, 13, 1114120, 65537, 13, 1179656, 65537, 13, 1245192, 65537, 13, 1310728, 65537, 13, 65545, 65537, 13, 131081, 65537, 13, 196617, 65537, 13, 262153, 65537, 13, 327689, 65537, 13, 393225, 65537, 13, 458761, 65537, 13, 524297, 65537, 13, 720905, 65537, 13, 786441, 65537, 13, 851977, 65537, 13, 917513, 65537, 13, 983049, 65537, 13, 1048585, 65537, 13, 1114121, 65537, 13, 1179657, 65537, 13, 1245193, 65537, 13, 1310729, 65537, 13, 65546, 65537, 13, 131082, 65537, 13, 196618, 65537, 13, 262154, 65537, 13, 327690, 65537, 13, 393226, 65537, 13, 458762, 65537, 13, 524298, 65537, 13, 720906, 65537, 13, 786442, 65537, 13, 851978, 65537, 13, 917514, 65537, 13, 983050, 65537, 13, 1048586, 65537, 13, 1114122, 65537, 13, 1179658, 65537, 13, 1245194, 65537, 13, 1310730, 65537, 13, 65547, 65537, 13, 131083, 65537, 13, 196619, 65537, 13, 262155, 65537, 13, 327691, 65537, 13, 393227, 65537, 13, 458763, 65537, 13, 524299, 65537, 13, 720907, 65537, 13, 786443, 65537, 13, 851979, 65537, 13, 917515, 65537, 13, 983051, 65537, 13, 1048587, 65537, 13, 1114123, 65537, 13, 1179659, 65537, 13, 1245195, 65537, 13, 1310731, 65537, 13, 65548, 65537, 13, 131084, 65537, 13, 196620, 65537, 13, 262156, 65537, 13, 327692, 65537, 13, 393228, 65537, 13, 458764, 65537, 13, 524300, 65537, 13, 720908, 65537, 13, 786444, 65537, 13, 851980, 65537, 13, 917516, 65537, 13, 983052, 65537, 13, 1048588, 65537, 13, 1114124, 65537, 13, 1179660, 65537, 13, 1245196, 65537, 13, 1310732, 65537, 13, 65549, 65537, 13, 131085, 65537, 13, 196621, 65537, 13, 262157, 65537, 13, 327693, 65537, 13, 393229, 65537, 13, 458765, 65537, 13, 524301, 65537, 13, 720909, 65537, 13, 786445, 65537, 13, 851981, 65537, 13, 917517, 65537, 13, 983053, 65537, 13, 1048589, 65537, 13, 1114125, 65537, 13, 1179661, 65537, 13, 1245197, 65537, 13, 1310733, 65537, 13, 65550, 65537, 13, 131086, 65537, 13, 196622, 65537, 13, 262158, 65537, 13, 327694, 65537, 13, 393230, 65537, 13, 458766, 65537, 13, 524302, 65537, 13, 720910, 65537, 13, 786446, 65537, 13, 851982, 65537, 13, 917518, 65537, 13, 983054, 65537, 13, 1048590, 65537, 13, 1114126, 65537, 13, 1179662, 65537, 13, 1245198, 65537, 13, 1310734, 65537, 13, 65551, 65537, 13, 131087, 65537, 13, 196623, 65537, 13, 262159, 65537, 13, 327695, 65537, 13, 393231, 65537, 13, 458767, 65537, 13, 524303, 65537, 13, 720911, 65537, 13, 786447, 65537, 13, 851983, 65537, 13, 917519, 65537, 13, 983055, 65537, 13, 1048591, 65537, 13, 1114127, 65537, 13, 1179663, 65537, 13, 1245199, 65537, 13, 1310735, 65537, 13, 65552, 65537, 13, 131088, 65537, 13, 196624, 65537, 13, 262160, 65537, 13, 327696, 65537, 13, 393232, 65537, 13, 458768, 65537, 13, 524304, 65537, 13, 720912, 65537, 13, 786448, 65537, 13, 851984, 65537, 13, 917520, 65537, 13, 983056, 65537, 13, 1048592, 65537, 13, 1114128, 65537, 13, 1179664, 65537, 13, 1245200, 65537, 13, 1310736, 65537, 13, 65553, 65537, 13, 131089, 65537, 13, 196625, 65537, 13, 262161, 65537, 13, 327697, 65537, 13, 393233, 65537, 13, 458769, 65537, 13, 524305, 65537, 13, 720913, 65537, 13, 786449, 65537, 13, 851985, 65537, 13, 917521, 65537, 13, 983057, 65537, 13, 1048593, 65537, 13, 1114129, 65537, 13, 1179665, 65537, 13, 1245201, 65537, 13, 1310737, 65537, 13, 65554, 65537, 13, 131090, 65537, 13, 196626, 65537, 13, 262162, 65537, 13, 327698, 65537, 13, 393234, 65537, 13, 458770, 65537, 13, 524306, 65537, 13, 720914, 65537, 13, 786450, 65537, 13, 851986, 65537, 13, 917522, 65537, 13, 983058, 65537, 13, 1048594, 65537, 13, 1114130, 65537, 13, 1179666, 65537, 13, 1245202, 65537, 13, 1310738, 65537, 13, 65555, 65537, 13, 131091, 65537, 13, 196627, 65537, 13, 262163, 65537, 13, 327699, 65537, 13, 393235, 65537, 13, 458771, 65537, 13, 524307, 65537, 13, 589843, 65537, 13, 655379, 65537, 13, 720915, 65537, 13, 786451, 65537, 13, 851987, 65537, 13, 917523, 65537, 13, 983059, 65537, 13, 1048595, 65537, 13, 1114131, 65537, 13, 1179667, 65537, 13, 1245203, 65537, 13, 1310739, 65537, 13, 65556, 65537, 13, 131092, 65537, 13, 196628, 65537, 13, 262164, 65537, 13, 327700, 65537, 13, 393236, 65537, 13, 458772, 65537, 13, 524308, 65537, 13, 589844, 65537, 13, 655380, 65537, 13, 720916, 65537, 13, 786452, 65537, 13, 851988, 65537, 13, 917524, 65537, 13, 983060, 65537, 13, 1048596, 65537, 13, 1114132, 65537, 13, 1179668, 65537, 13, 1245204, 65537, 13, 1310740, 65537, 13, 65557, 65537, 13, 131093, 65537, 13, 196629, 65537, 13, 262165, 65537, 13, 327701, 65537, 13, 393237, 65537, 13, 458773, 65537, 13, 524309, 65537, 13, 589845, 65537, 13, 655381, 65537, 13, 720917, 65537, 13, 786453, 65537, 13, 851989, 65537, 13, 917525, 65537, 13, 983061, 65537, 13, 1048597, 65537, 13, 1114133, 65537, 13, 1179669, 65537, 13, 1245205, 65537, 13, 1310741, 65537, 13, 65558, 65537, 13, 131094, 65537, 13, 196630, 65537, 13, 262166, 65537, 13, 327702, 65537, 13, 393238, 65537, 13, 458774, 65537, 13, 524310, 65537, 13, 589846, 65537, 13, 655382, 65537, 13, 720918, 65537, 13, 786454, 65537, 13, 851990, 65537, 13, 917526, 65537, 13, 983062, 65537, 13, 1048598, 65537, 13, 1114134, 65537, 13, 1179670, 65537, 13, 1245206, 65537, 13, 1310742, 65537, 13, 65559, 655361, 18, 131095, 655361, 17, 196631, 65537, 13, 262167, 65537, 13, 327703, 65537, 13, 393239, 65537, 13, 458775, 65537, 13, 524311, 65537, 13, 589847, 65537, 13, 655383, 65537, 13, 720919, 65537, 13, 786455, 65537, 13, 851991, 65537, 13, 917527, 65537, 13, 983063, 65537, 13, 1048599, 65537, 13, 1114135, 65537, 13, 1179671, 65537, 13, 1245207, 65537, 13, 1310743, 65537, 13, 65560, 65537, 13, 131096, 65537, 13, 196632, 65537, 13, 262168, 65537, 13, 327704, 65537, 13, 393240, 65537, 13, 458776, 65537, 13, 524312, 65537, 13, 589848, 65537, 13, 655384, 65537, 13, 720920, 65537, 13, 786456, 65537, 13, 851992, 65537, 13, 917528, 65537, 13, 983064, 65537, 13, 1048600, 65537, 13, 1114136, 65537, 13, 1179672, 65537, 13, 1245208, 65537, 13, 1310744, 65537, 13, 24, 65537, 13) + +[node name="SceneTransition" parent="." instance=ExtResource("2_gy81g")] +position = Vector2(392, 8) +rotation = 3.14159 +sceneFilePath = "res://Scenes/Maps/World.tscn" +targetPlayerPositionNodePath = "PlayerPosition" + +[node name="PlayerPosition" type="Node2D" parent="."] +position = Vector2(392, 16) diff --git a/Scenes/Maps/World.gd b/Scenes/Maps/World.gd new file mode 100644 index 0000000..a33ee34 --- /dev/null +++ b/Scenes/Maps/World.gd @@ -0,0 +1,94 @@ +extends "res://Scenes/Maps/Map.gd" + + +func _ready(): + super._ready() + + $Areas/Main.connect("body_entered", func(body): self._area_entered($Areas/Main, body)) + $Areas/Room.connect("body_entered", func(body): self._area_entered($Areas/Room, body)) + $Areas/Room_right.connect("body_entered", func(body): self._area_entered($Areas/Room_right, body)) + $Areas/Room_bottom.connect("body_entered", func(body): self._area_entered($Areas/Room_bottom, body)) + + self.adjust_camera_to_area($Player, $Areas/Room, false) + + for i in 6: + var enemy = preload("res://Scenes/Entities/Enemies/Enemy.tscn").instantiate() + enemy.position = Vector2(randi_range(3, 10), randi_range(3, 10)) * 16 + enemy.health = 4*(i+1) + $Areas/Main/TileMap.add_child(enemy) + + +func _area_entered(source: Area2D, body: Node2D): + var exited_area = Global.last_area + + source.get_node("TileMap").visible = true + + var player = body + self.adjust_camera_to_area(player, source) + + if exited_area: + exited_area.get_node("TileMap").process_mode = PROCESS_MODE_DISABLED + + var tween = get_tree().create_tween() + tween.tween_property( + player, "position", player.position + player.DIRECTION * 16, 1.25 + ) + tween.tween_callback(func(): + exited_area.get_node("TileMap").visible = false + ) + + source.get_node("TileMap").process_mode = PROCESS_MODE_INHERIT + + Global.last_area = source + + +func _area_exited(_source: Area2D, _body: Node2D): + pass + + +func adjust_camera_to_area(player: Player, map_area: Area2D, animate: bool = true) -> Camera2D: + var camera: Camera2D = player.get_node("Camera2D") + var bounds: Rect2 = Utilities.get_collision_shape_bounds(map_area.get_node("CollisionShape2D")) + #var enter_direction_vector = player.position - collision_shape.position + + var duration = 0 + if animate: + duration = 1.25 + + var tween = get_tree().create_tween().set_parallel().set_ease(Tween.EASE_OUT) + + #if enter_direction_vector.x > 0: + tween.tween_property(camera, "limit_right", bounds.end.x, duration) + #elif enter_direction_vector.x < 0: + tween.tween_property(camera, "limit_left", bounds.position.x, duration) + + #if enter_direction_vector.y > 0: + tween.tween_property(camera, "limit_bottom", bounds.end.y, duration) + #elif enter_direction_vector.y < 0: + tween.tween_property(camera, "limit_top", bounds.position.y, duration) + + #if abs(localRect.size.x) >= abs(viewportRect.size.x): + #camera.set_limit(SIDE_LEFT, localRect.position.x) + #get_tree().create_tween().tween_property(camera, "limit_left", bounds.position.x, duration).set_ease(Tween.EASE_OUT) + #else: + #camera.set_limit(SIDE_LEFT, -10000000) + + #if abs(localRect.size.y) >= abs(viewportRect.size.y): + #camera.set_limit(SIDE_TOP, localRect.position.y) + #get_tree().create_tween().tween_property(camera, "limit_top", bounds.position.y, duration).set_ease(Tween.EASE_OUT) + #else: + #camera.set_limit(SIDE_TOP, -10000000) + + #if abs(localRect.size.x) >= abs(viewportRect.size.x): + #camera.set_limit(SIDE_RIGHT, localRect.end.x) + #get_tree().create_tween().tween_property(camera, "limit_right", bounds.end.x, duration).set_ease(Tween.EASE_OUT) + #else: + #camera.set_limit(SIDE_RIGHT, 10000000) + + #if abs(localRect.size.y) >= abs(viewportRect.size.y): + #camera.set_limit(SIDE_BOTTOM, localRect.end.y) + #get_tree().create_tween().tween_property(camera, "limit_bottom", bounds.end.y, duration).set_ease(Tween.EASE_OUT) + #else: + #camera.set_limit(SIDE_BOTTOM, 10000000) + + return camera diff --git a/Scenes/Maps/World.tscn b/Scenes/Maps/World.tscn new file mode 100644 index 0000000..2414d14 --- /dev/null +++ b/Scenes/Maps/World.tscn @@ -0,0 +1,128 @@ +[gd_scene load_steps=13 format=3 uid="uid://45xfj36bdsjw"] + +[ext_resource type="Script" path="res://Scenes/Maps/World.gd" id="1_7jam1"] +[ext_resource type="PackedScene" uid="uid://d0t04jox4oxsv" path="res://Scenes/Components/TileMap.tscn" id="2_hrdtq"] +[ext_resource type="PackedScene" uid="uid://c5ix2njry0181" path="res://Scenes/Components/SceneTransition.tscn" id="3_n745i"] +[ext_resource type="PackedScene" uid="uid://dgyk1sged38ct" path="res://Scenes/Entities/Enemies/Enemy.tscn" id="3_p230b"] +[ext_resource type="Script" path="res://Scenes/Components/MapArea.gd" id="4_5p13h"] +[ext_resource type="PackedScene" uid="uid://cluuq4bwb8ebs" path="res://Scenes/Components/PlayerPosition.tscn" id="6_tmdwn"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_ts8f5"] +size = Vector2(304, 208) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_dfqdh"] +size = Vector2(304, 176) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_72gwc"] +size = Vector2(256, 160) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_pj3t1"] +size = Vector2(256, 176) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_lo7hy"] +size = Vector2(240, 160) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_v1l1t"] +size = Vector2(240, 160) + +[node name="World" type="Node2D"] +script = ExtResource("1_7jam1") + +[node name="Areas" type="Node" parent="."] + +[node name="Main" type="Area2D" parent="Areas"] +collision_layer = 0 +collision_mask = 2 + +[node name="TileMap" parent="Areas/Main" instance=ExtResource("2_hrdtq")] +layer_0/tile_data = PackedInt32Array(0, 655361, 18, 65536, 655361, 18, 131072, 655361, 18, 458752, 655361, 18, 1, 655361, 17, 65537, 65537, 13, 131073, 65537, 13, 196609, 65537, 13, 262145, 65537, 13, 2, 655361, 17, 65538, 65537, 13, 131074, 65537, 13, 196610, 65537, 13, 262146, 65537, 13, 458754, 65537, 13, 3, 655361, 17, 65539, 65537, 13, 131075, 65537, 13, 196611, 65537, 13, 262147, 65537, 13, 458755, 65537, 13, 4, 655361, 17, 65540, 65537, 13, 131076, 65537, 13, 458756, 65537, 13, 5, 655361, 17, 65541, 65537, 13, 131077, 65537, 13, 196608, 655361, 18, 262144, 655361, 18, 393216, 655361, 18, 327680, 655361, 18, 6, 655361, 17, 65542, 65537, 13, 131078, 65537, 13, 196614, 65537, 13, 262150, 65537, 13, 327686, 65537, 13, 393222, 65537, 13, 458758, 65537, 13, 458757, 65537, 13, 196613, 65537, 13, 196612, 65537, 13, 262148, 65537, 13, 262149, 65537, 13, 327685, 65537, 13, 393221, 65537, 13, 393220, 65537, 13, 327684, 65537, 13, 327683, 65537, 13, 327682, 65537, 13, 327681, 65537, 13, 393219, 65537, 13, 393218, 65537, 13, 458753, 65537, 13, 524294, 65537, 13, 524293, 65537, 13, 524292, 65537, 13, 524291, 65537, 13, 524290, 65537, 13, 524288, 655361, 18, 589824, 655361, 18, 655360, 655361, 18, 720896, 655361, 18, 786432, 655361, 18, 786438, 655361, 18, 720902, 65537, 13, 655366, 65537, 13, 589830, 65537, 13, 524289, 65537, 13, 589825, 65537, 13, 655361, 65537, 13, 720897, 65537, 13, 720898, 65537, 13, 720899, 65537, 13, 720900, 65537, 13, 720901, 65537, 13, 655365, 65537, 13, 589829, 65537, 13, 589828, 65537, 13, 589827, 65537, 13, 589826, 65537, 13, 655362, 65537, 13, 655363, 65537, 13, 655364, 65537, 13, 393217, 65537, 13, 786433, 65537, 13, 786437, 655361, 18, 786436, 655361, 18, 786435, 655361, 18, 786434, 655361, 18, 65543, 65537, 13, 65544, 65537, 13, 65545, 65537, 13, 65546, 65537, 13, 65547, 65537, 13, 65548, 65537, 13, 65549, 65537, 13, 65550, 65537, 13, 65551, 65537, 13, 65552, 65537, 13, 65553, 65537, 13, 131079, 65537, 13, 196615, 65537, 13, 262151, 65537, 13, 327687, 65537, 13, 393223, 65537, 13, 458759, 65537, 13, 524295, 65537, 13, 589831, 65537, 13, 655367, 65537, 13, 720903, 65537, 13, 131080, 65537, 13, 196616, 65537, 13, 262152, 65537, 13, 327688, 65537, 13, 393224, 65537, 13, 458760, 65537, 13, 524296, 65537, 13, 589832, 65537, 13, 655368, 65537, 13, 720904, 65537, 13, 131081, 65537, 13, 196617, 65537, 13, 262153, 65537, 13, 327689, 65537, 13, 393225, 65537, 13, 458761, 65537, 13, 524297, 65537, 13, 589833, 65537, 13, 655369, 65537, 13, 720905, 65537, 13, 131082, 65537, 13, 196618, 65537, 13, 262154, 65537, 13, 327690, 65537, 13, 393226, 65537, 13, 458762, 65537, 13, 524298, 65537, 13, 589834, 65537, 13, 655370, 65537, 13, 720906, 65537, 13, 131083, 65537, 13, 196619, 65537, 13, 262155, 65537, 13, 327691, 65537, 13, 393227, 65537, 13, 458763, 65537, 13, 524299, 65537, 13, 589835, 65537, 13, 655371, 65537, 13, 720907, 65537, 13, 131084, 65537, 13, 196620, 65537, 13, 262156, 65537, 13, 327692, 65537, 13, 393228, 65537, 13, 458764, 65537, 13, 524300, 65537, 13, 589836, 65537, 13, 655372, 65537, 13, 720908, 65537, 13, 131085, 65537, 13, 196621, 65537, 13, 262157, 65537, 13, 327693, 65537, 13, 393229, 65537, 13, 458765, 65537, 13, 524301, 65537, 13, 589837, 65537, 13, 655373, 65537, 13, 720909, 65537, 13, 131086, 65537, 13, 196622, 65537, 13, 262158, 65537, 13, 327694, 65537, 13, 393230, 65537, 13, 458766, 65537, 13, 524302, 65537, 13, 589838, 65537, 13, 655374, 65537, 13, 720910, 65537, 13, 131087, 65537, 13, 196623, 65537, 13, 262159, 65537, 13, 327695, 65537, 13, 393231, 65537, 13, 458767, 65537, 13, 524303, 65537, 13, 589839, 65537, 13, 655375, 65537, 13, 720911, 65537, 13, 131088, 65537, 13, 196624, 65537, 13, 262160, 65537, 13, 327696, 65537, 13, 393232, 65537, 13, 458768, 65537, 13, 524304, 65537, 13, 589840, 65537, 13, 655376, 65537, 13, 720912, 65537, 13, 131089, 65537, 13, 196625, 65537, 13, 262161, 65537, 13, 327697, 65537, 13, 393233, 65537, 13, 458769, 65537, 13, 524305, 65537, 13, 589841, 65537, 13, 655377, 65537, 13, 720913, 65537, 13, 7, 655361, 17, 8, 655361, 17, 9, 655361, 17, 10, 655361, 17, 11, 655361, 17, 12, 655361, 17, 13, 655361, 17, 14, 655361, 17, 15, 655361, 17, 16, 655361, 17, 17, 655361, 17, 18, 655361, 18, 65554, 655361, 17, 196626, 655361, 18, 262162, 655361, 18, 327698, 655361, 18, 393234, 655361, 18, 458770, 655361, 18, 524306, 655361, 18, 589842, 655361, 18, 655378, 655361, 18, 720914, 655361, 18, 786450, 655361, 18, 786449, 655361, 18, 786448, 655361, 18, 786447, 655361, 18, 786446, 655361, 18, 786445, 655361, 18, 786444, 655361, 18, 786443, 655361, 18, 786442, 655361, 18, 786441, 655361, 18, 786440, 655361, 18, 786439, 655361, 18, 131090, 65537, 13) +layer_1/tile_data = PackedInt32Array(65537, 2, 65536, 196609, 2, 65536, 327681, 2, 65536, 65539, 2, 65536, 327683, 2, 65536, 65541, 2, 65536, 196613, 2, 65536, 327685, 2, 65536) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Areas/Main"] +position = Vector2(152, 104) +shape = SubResource("RectangleShape2D_ts8f5") + +[node name="Room" type="Area2D" parent="Areas"] +collision_layer = 0 +collision_mask = 2 + +[node name="TileMap" parent="Areas/Room" instance=ExtResource("2_hrdtq")] +layer_0/tile_data = PackedInt32Array(851986, 655361, 18, 851985, 655361, 17, 851984, 655361, 17, 851983, 655361, 17, 851982, 655361, 17, 851981, 655361, 17, 851980, 655361, 17, 851979, 655361, 17, 851978, 655361, 17, 851977, 655361, 17, 851976, 655361, 17, 851975, 655361, 17, 851974, 655361, 17, 851973, 655361, 17, 851972, 655361, 17, 851971, 655361, 17, 851970, 655361, 17, 851968, 655361, 18, 917504, 655361, 17, 983040, 65537, 13, 917522, 655361, 17, 1048576, 655361, 18, 917505, 65537, 13, 983041, 65537, 13, 917506, 65537, 13, 983042, 65537, 13, 917507, 65537, 13, 983043, 65537, 13, 917508, 65537, 13, 983044, 65537, 13, 917509, 65537, 13, 983045, 65537, 13, 917510, 65537, 13, 983046, 65537, 13, 917511, 65537, 13, 983047, 65537, 13, 917512, 65537, 13, 983048, 65537, 13, 917513, 65537, 13, 983049, 65537, 13, 917514, 65537, 13, 983050, 65537, 13, 917515, 65537, 13, 983051, 65537, 13, 917516, 65537, 13, 983052, 65537, 13, 917517, 65537, 13, 983053, 65537, 13, 917518, 65537, 13, 983054, 65537, 13, 917519, 65537, 13, 983055, 65537, 13, 917520, 65537, 13, 983056, 65537, 13, 917521, 65537, 13, 983057, 65537, 13, 851969, 65537, 13, 983058, 65537, 13, 1048594, 655361, 18, 1114130, 655361, 18, 1179666, 655361, 18, 1245202, 655361, 18, 1310738, 655361, 18, 1376274, 655361, 18, 1441810, 655361, 18, 1507346, 655361, 17, 1507345, 655361, 17, 1507344, 655361, 17, 1507343, 655361, 17, 1507342, 655361, 17, 1507341, 655361, 17, 1507340, 655361, 17, 1507339, 655361, 17, 1507338, 655361, 17, 1507336, 655361, 17, 1507335, 655361, 17, 1507334, 655361, 17, 1507333, 655361, 17, 1507332, 655361, 17, 1507331, 655361, 17, 1507330, 655361, 17, 1507329, 655361, 17, 1507328, 655361, 17, 1114112, 655361, 18, 1179648, 655361, 18, 1245184, 655361, 18, 1310720, 655361, 18, 1376256, 655361, 18, 1441792, 655361, 18, 1048577, 65537, 13, 1114113, 65537, 13, 1179649, 65537, 13, 1245185, 65537, 13, 1310721, 65537, 13, 1376257, 65537, 13, 1441793, 65537, 13, 1048578, 65537, 13, 1114114, 65537, 13, 1179650, 65537, 13, 1245186, 65537, 13, 1310722, 65537, 13, 1376258, 65537, 13, 1441794, 65537, 13, 1048579, 65537, 13, 1114115, 65537, 13, 1179651, 65537, 13, 1245187, 65537, 13, 1310723, 65537, 13, 1376259, 65537, 13, 1441795, 65537, 13, 1048580, 65537, 13, 1114116, 65537, 13, 1179652, 65537, 13, 1245188, 65537, 13, 1310724, 65537, 13, 1376260, 65537, 13, 1441796, 65537, 13, 1048581, 65537, 13, 1114117, 65537, 13, 1179653, 65537, 13, 1245189, 65537, 13, 1310725, 65537, 13, 1376261, 65537, 13, 1441797, 65537, 13, 1048582, 65537, 13, 1114118, 65537, 13, 1179654, 65537, 13, 1245190, 65537, 13, 1310726, 65537, 13, 1376262, 65537, 13, 1441798, 65537, 13, 1048583, 65537, 13, 1114119, 65537, 13, 1179655, 65537, 13, 1245191, 65537, 13, 1310727, 65537, 13, 1376263, 65537, 13, 1441799, 65537, 13, 1048584, 65537, 13, 1114120, 65537, 13, 1179656, 65537, 13, 1245192, 65537, 13, 1310728, 65537, 13, 1376264, 65537, 13, 1441800, 65537, 13, 1048585, 65537, 13, 1114121, 65537, 13, 1179657, 65537, 13, 1245193, 65537, 13, 1310729, 65537, 13, 1376265, 65537, 13, 1441801, 65537, 13, 1048586, 65537, 13, 1114122, 65537, 13, 1179658, 65537, 13, 1245194, 65537, 13, 1310730, 65537, 13, 1376266, 65537, 13, 1441802, 65537, 13, 1048587, 65537, 13, 1114123, 65537, 13, 1179659, 65537, 13, 1245195, 65537, 13, 1310731, 65537, 13, 1376267, 65537, 13, 1441803, 65537, 13, 1048588, 65537, 13, 1114124, 65537, 13, 1179660, 65537, 13, 1245196, 65537, 13, 1310732, 65537, 13, 1376268, 65537, 13, 1441804, 65537, 13, 1048589, 65537, 13, 1114125, 65537, 13, 1179661, 65537, 13, 1245197, 65537, 13, 1310733, 65537, 13, 1376269, 65537, 13, 1441805, 65537, 13, 1048590, 65537, 13, 1114126, 65537, 13, 1179662, 65537, 13, 1245198, 65537, 13, 1310734, 65537, 13, 1376270, 65537, 13, 1441806, 65537, 13, 1048591, 65537, 13, 1114127, 65537, 13, 1179663, 65537, 13, 1245199, 65537, 13, 1310735, 65537, 13, 1376271, 65537, 13, 1441807, 65537, 13, 1048592, 65537, 13, 1114128, 65537, 13, 1179664, 65537, 13, 1245200, 65537, 13, 1310736, 65537, 13, 1376272, 65537, 13, 1441808, 65537, 13, 1048593, 65537, 13, 1114129, 65537, 13, 1179665, 65537, 13, 1245201, 65537, 13, 1310737, 65537, 13, 1376273, 65537, 13, 1441809, 65537, 13, 1507337, 65537, 13) + +[node name="Enemy" parent="Areas/Room/TileMap" instance=ExtResource("3_p230b")] +position = Vector2(133, 290) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Areas/Room"] +position = Vector2(152, 296) +shape = SubResource("RectangleShape2D_dfqdh") + +[node name="Room_right" type="Area2D" parent="Areas"] +collision_layer = 0 +collision_mask = 2 + +[node name="TileMap" parent="Areas/Room_right" instance=ExtResource("2_hrdtq")] +layer_0/tile_data = PackedInt32Array(19, 655361, 18, 65555, 655361, 17, 196627, 655361, 18, 262163, 655361, 18, 327699, 655361, 18, 393235, 655361, 18, 458771, 655361, 18, 524307, 655361, 18, 20, 655361, 17, 65556, 65537, 13, 131092, 65537, 13, 196628, 65537, 13, 262164, 65537, 13, 327700, 65537, 13, 393236, 65537, 13, 458772, 65537, 13, 21, 655361, 17, 65557, 65537, 13, 131093, 65537, 13, 196629, 65537, 13, 262165, 65537, 13, 327701, 65537, 13, 393237, 65537, 13, 458773, 65537, 13, 22, 655361, 17, 65558, 65537, 13, 131094, 65537, 13, 196630, 65537, 13, 262166, 65537, 13, 327702, 65537, 13, 393238, 65537, 13, 458774, 65537, 13, 23, 655361, 17, 65559, 65537, 13, 131095, 65537, 13, 196631, 65537, 13, 262167, 65537, 13, 327703, 65537, 13, 393239, 65537, 13, 458775, 65537, 13, 24, 655361, 17, 65560, 65537, 13, 131096, 65537, 13, 196632, 65537, 13, 262168, 65537, 13, 327704, 65537, 13, 393240, 65537, 13, 458776, 65537, 13, 25, 655361, 17, 65561, 65537, 13, 131097, 65537, 13, 196633, 65537, 13, 262169, 65537, 13, 327705, 65537, 13, 393241, 65537, 13, 458777, 65537, 13, 26, 655361, 17, 65562, 65537, 13, 131098, 65537, 13, 196634, 65537, 13, 262170, 65537, 13, 327706, 65537, 13, 393242, 65537, 13, 458778, 65537, 13, 27, 655361, 17, 65563, 65537, 13, 131099, 65537, 13, 196635, 65537, 13, 262171, 65537, 13, 327707, 65537, 13, 393243, 65537, 13, 458779, 65537, 13, 28, 655361, 17, 524314, 65537, 13, 131091, 65537, 13, 65564, 65537, 13, 131100, 65537, 13, 196636, 65537, 13, 262172, 65537, 13, 327708, 65537, 13, 393244, 65537, 13, 458780, 65537, 13, 65565, 65537, 13, 131101, 65537, 13, 196637, 65537, 13, 262173, 65537, 13, 327709, 65537, 13, 393245, 65537, 13, 458781, 65537, 13, 65566, 65537, 13, 131102, 65537, 13, 196638, 65537, 13, 262174, 65537, 13, 327710, 65537, 13, 393246, 65537, 13, 458782, 65537, 13, 65567, 65537, 13, 131103, 65537, 13, 196639, 65537, 13, 262175, 65537, 13, 327711, 65537, 13, 393247, 65537, 13, 458783, 65537, 13, 65568, 65537, 13, 131104, 65537, 13, 196640, 65537, 13, 262176, 65537, 13, 327712, 65537, 13, 393248, 65537, 13, 458784, 65537, 13, 65569, 65537, 13, 131105, 65537, 13, 196641, 65537, 13, 262177, 65537, 13, 327713, 65537, 13, 393249, 65537, 13, 458785, 65537, 13, 29, 655361, 17, 30, 655361, 17, 31, 655361, 17, 32, 655361, 17, 33, 655361, 17, 34, 655361, 18, 65570, 655361, 17, 196642, 655361, 18, 262178, 655361, 18, 327714, 655361, 18, 393250, 655361, 18, 458786, 655361, 18, 524322, 655361, 18, 589858, 655361, 18, 589857, 655361, 18, 589856, 655361, 18, 589855, 655361, 18, 589854, 655361, 18, 589853, 655361, 18, 589852, 655361, 18, 589851, 655361, 18, 589849, 655361, 18, 589848, 655361, 18, 589847, 655361, 18, 589846, 655361, 18, 589845, 655361, 18, 589844, 655361, 18, 589843, 655361, 18, 524308, 65537, 13, 524309, 65537, 13, 524310, 65537, 13, 524311, 65537, 13, 524312, 65537, 13, 524313, 65537, 13, 524315, 65537, 13, 524316, 65537, 13, 524317, 65537, 13, 524318, 65537, 13, 524319, 65537, 13, 524320, 65537, 13, 524321, 65537, 13, 589850, 65537, 13, 131106, 65537, 13) + +[node name="Enemy" parent="Areas/Room_right/TileMap" instance=ExtResource("3_p230b")] +position = Vector2(415, 42) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Areas/Room_right"] +position = Vector2(432, 80) +shape = SubResource("RectangleShape2D_72gwc") + +[node name="Room_bottom" type="Area2D" parent="Areas"] +collision_layer = 0 +collision_mask = 2 + +[node name="TileMap" parent="Areas/Room_bottom" instance=ExtResource("2_hrdtq")] +layer_0/tile_data = PackedInt32Array(1310742, 655361, 17, 1310743, 655361, 17, 1310744, 655361, 17, 1310745, 655361, 17, 1310746, 655361, 17, 1310747, 655361, 17, 1310748, 655361, 17, 1245212, 65537, 13, 1179676, 65537, 13, 1114140, 65537, 13, 1048604, 65537, 13, 983068, 65537, 13, 917532, 65537, 13, 851996, 65537, 13, 786460, 65537, 13, 720924, 65537, 13, 655388, 655361, 17, 655379, 655361, 18, 720915, 655361, 18, 786451, 655361, 18, 851987, 655361, 18, 917523, 655361, 17, 983059, 65537, 13, 655380, 655361, 17, 720916, 65537, 13, 786452, 65537, 13, 851988, 65537, 13, 917524, 65537, 13, 983060, 65537, 13, 655381, 655361, 17, 720917, 65537, 13, 786453, 65537, 13, 851989, 65537, 13, 917525, 65537, 13, 983061, 65537, 13, 655382, 655361, 17, 720918, 65537, 13, 786454, 65537, 13, 851990, 65537, 13, 917526, 65537, 13, 983062, 65537, 13, 655383, 655361, 17, 720919, 65537, 13, 786455, 65537, 13, 851991, 65537, 13, 917527, 65537, 13, 983063, 65537, 13, 655384, 655361, 17, 720920, 65537, 13, 786456, 65537, 13, 851992, 65537, 13, 917528, 65537, 13, 983064, 65537, 13, 655385, 655361, 17, 720921, 65537, 13, 786457, 65537, 13, 851993, 65537, 13, 917529, 65537, 13, 983065, 65537, 13, 720922, 65537, 13, 786458, 65537, 13, 851994, 65537, 13, 917530, 65537, 13, 983066, 65537, 13, 655387, 655361, 17, 720923, 65537, 13, 786459, 65537, 13, 851995, 65537, 13, 917531, 65537, 13, 983067, 65537, 13, 1048598, 65537, 13, 1114134, 65537, 13, 1179670, 65537, 13, 1245206, 65537, 13, 1048599, 65537, 13, 1114135, 65537, 13, 1179671, 65537, 13, 1245207, 65537, 13, 1048600, 65537, 13, 1114136, 65537, 13, 1179672, 65537, 13, 1245208, 65537, 13, 1048601, 65537, 13, 1114137, 65537, 13, 1179673, 65537, 13, 1245209, 65537, 13, 1048602, 65537, 13, 1114138, 65537, 13, 1179674, 65537, 13, 1245210, 65537, 13, 1048603, 65537, 13, 1114139, 65537, 13, 1179675, 65537, 13, 1245211, 65537, 13, 1310739, 655361, 17, 1310740, 655361, 17, 1310741, 655361, 17, 1048595, 655361, 18, 1114131, 655361, 18, 1179667, 655361, 18, 1245203, 655361, 18, 1048596, 65537, 13, 1114132, 65537, 13, 1179668, 65537, 13, 1245204, 65537, 13, 1048597, 65537, 13, 1114133, 65537, 13, 1179669, 65537, 13, 1245205, 65537, 13, 655389, 655361, 17, 720925, 65537, 13, 786461, 65537, 13, 851997, 65537, 13, 917533, 65537, 13, 983069, 65537, 13, 1048605, 65537, 13, 1114141, 65537, 13, 1179677, 65537, 13, 1245213, 65537, 13, 655390, 655361, 17, 720926, 65537, 13, 786462, 65537, 13, 851998, 65537, 13, 917534, 65537, 13, 983070, 65537, 13, 1048606, 65537, 13, 1114142, 65537, 13, 1179678, 65537, 13, 1245214, 65537, 13, 655391, 655361, 17, 720927, 65537, 13, 786463, 65537, 13, 851999, 65537, 13, 917535, 65537, 13, 983071, 65537, 13, 1048607, 65537, 13, 1114143, 65537, 13, 1179679, 65537, 13, 1245215, 65537, 13, 655392, 655361, 17, 720928, 65537, 13, 786464, 65537, 13, 852000, 65537, 13, 917536, 65537, 13, 983072, 65537, 13, 1048608, 65537, 13, 1114144, 65537, 13, 1179680, 65537, 13, 1245216, 65537, 13, 655393, 655361, 17, 720929, 65537, 13, 786465, 65537, 13, 852001, 65537, 13, 917537, 65537, 13, 983073, 65537, 13, 1048609, 65537, 13, 1114145, 65537, 13, 1179681, 65537, 13, 1245217, 65537, 13, 1310749, 655361, 17, 1310750, 655361, 17, 1310751, 655361, 17, 1310752, 655361, 17, 1310753, 655361, 17, 1310754, 655361, 17, 655394, 655361, 18, 720930, 655361, 18, 786466, 655361, 18, 852002, 655361, 18, 917538, 655361, 18, 983074, 655361, 18, 1048610, 655361, 18, 1114146, 655361, 18, 1179682, 655361, 18, 1245218, 655361, 18, 655386, 65537, 13) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Areas/Room_bottom"] +position = Vector2(432, 248) +shape = SubResource("RectangleShape2D_pj3t1") + +[node name="MapArea" type="Area2D" parent="Areas"] +collision_layer = 0 +collision_mask = 2 +script = ExtResource("4_5p13h") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Areas/MapArea"] +position = Vector2(680, 80) +shape = SubResource("RectangleShape2D_lo7hy") + +[node name="TileMap" parent="Areas/MapArea" instance=ExtResource("2_hrdtq")] +layer_0/tile_data = PackedInt32Array(35, 655361, 18, 65571, 655361, 17, 131107, 65537, 13, 196643, 655361, 18, 262179, 655361, 18, 327715, 655361, 18, 393251, 655361, 18, 458787, 655361, 18, 524323, 655361, 18, 589859, 655361, 17, 36, 655361, 17, 65572, 65537, 13, 131108, 65537, 13, 196644, 65537, 13, 262180, 65537, 13, 327716, 65537, 13, 393252, 65537, 13, 458788, 65537, 13, 524324, 65537, 13, 589860, 655361, 17, 37, 655361, 17, 65573, 65537, 13, 131109, 65537, 13, 196645, 65537, 13, 262181, 65537, 13, 327717, 65537, 13, 393253, 65537, 13, 458789, 65537, 13, 524325, 65537, 13, 589861, 655361, 17, 38, 655361, 17, 65574, 65537, 13, 131110, 65537, 13, 196646, 65537, 13, 262182, 65537, 13, 327718, 65537, 13, 458790, 65537, 13, 524326, 65537, 13, 589862, 655361, 17, 39, 655361, 17, 65575, 65537, 13, 131111, 65537, 13, 196647, 65537, 13, 262183, 65537, 13, 327719, 65537, 13, 524327, 65537, 13, 589863, 655361, 17, 40, 655361, 17, 65576, 65537, 13, 131112, 65537, 13, 196648, 65537, 13, 262184, 65537, 13, 327720, 65537, 13, 393256, 65537, 13, 524328, 65537, 13, 589864, 655361, 17, 41, 655361, 17, 65577, 65537, 13, 131113, 65537, 13, 196649, 65537, 13, 262185, 65537, 13, 327721, 65537, 13, 393257, 65537, 13, 458793, 65537, 13, 524329, 65537, 13, 589865, 655361, 17, 42, 655361, 17, 65578, 65537, 13, 131114, 65537, 13, 196650, 65537, 13, 262186, 65537, 13, 327722, 65537, 13, 393258, 65537, 13, 458794, 65537, 13, 524330, 65537, 13, 589866, 655361, 17, 43, 655361, 17, 65579, 65537, 13, 131115, 65537, 13, 196651, 65537, 13, 262187, 65537, 13, 327723, 65537, 13, 393259, 65537, 13, 458795, 65537, 13, 524331, 65537, 13, 589867, 655361, 17, 44, 655361, 17, 65580, 65537, 13, 131116, 65537, 13, 196652, 65537, 13, 262188, 65537, 13, 327724, 65537, 13, 393260, 65537, 13, 458796, 65537, 13, 524332, 65537, 13, 589868, 655361, 17, 45, 655361, 17, 65581, 65537, 13, 131117, 65537, 13, 196653, 65537, 13, 262189, 65537, 13, 327725, 65537, 13, 393261, 65537, 13, 458797, 65537, 13, 524333, 65537, 13, 589869, 655361, 17, 46, 655361, 17, 65582, 65537, 13, 131118, 65537, 13, 196654, 65537, 13, 262190, 65537, 13, 327726, 65537, 13, 393262, 65537, 13, 458798, 65537, 13, 524334, 65537, 13, 589870, 655361, 17, 47, 655361, 17, 65583, 65537, 13, 131119, 65537, 13, 196655, 65537, 13, 262191, 65537, 13, 327727, 65537, 13, 393263, 65537, 13, 458799, 65537, 13, 524335, 65537, 13, 589871, 655361, 17, 48, 655361, 17, 65584, 65537, 13, 131120, 65537, 13, 196656, 65537, 13, 262192, 65537, 13, 327728, 65537, 13, 393264, 65537, 13, 458800, 65537, 13, 524336, 65537, 13, 589872, 655361, 17, 49, 655361, 18, 65585, 655361, 18, 131121, 655361, 18, 196657, 655361, 18, 262193, 655361, 18, 327729, 655361, 18, 393265, 655361, 18, 458801, 655361, 18, 524337, 655361, 18, 589873, 655361, 17, 393254, 65537, 13, 393255, 65537, 13, 458792, 65537, 13, 458791, 65537, 13) + +[node name="MapArea2" type="Area2D" parent="Areas"] +collision_layer = 0 +collision_mask = 2 +script = ExtResource("4_5p13h") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Areas/MapArea2"] +position = Vector2(-120, 304) +shape = SubResource("RectangleShape2D_v1l1t") + +[node name="TileMap" parent="Areas/MapArea2" instance=ExtResource("2_hrdtq")] +layer_0/tile_data = PackedInt32Array(983025, 655361, 18, 1048561, 655361, 18, 1114097, 655361, 18, 1179633, 655361, 18, 1245169, 655361, 18, 1310705, 655361, 18, 1376241, 655361, 18, 1441777, 655361, 18, 1507313, 655361, 18, 1572849, 655361, 17, 983026, 655361, 17, 1048562, 65537, 13, 1114098, 65537, 13, 1179634, 65537, 13, 1245170, 65537, 13, 1310706, 65537, 13, 1376242, 65537, 13, 1441778, 65537, 13, 1507314, 65537, 13, 1572850, 655361, 17, 1048563, 65537, 13, 1114099, 65537, 13, 1179635, 65537, 13, 1245171, 65537, 13, 1310707, 65537, 13, 1376243, 65537, 13, 1441779, 65537, 13, 1507315, 65537, 13, 1572851, 655361, 17, 983028, 655361, 17, 1048564, 65537, 13, 1114100, 65537, 13, 1179636, 65537, 13, 1245172, 65537, 13, 1310708, 65537, 13, 1376244, 65537, 13, 1441780, 65537, 13, 1507316, 65537, 13, 1572852, 655361, 17, 983029, 655361, 17, 1048565, 65537, 13, 1114101, 65537, 13, 1179637, 65537, 13, 1245173, 65537, 13, 1310709, 65537, 13, 1376245, 65537, 13, 1441781, 65537, 13, 1507317, 65537, 13, 1572853, 655361, 17, 983030, 655361, 17, 1048566, 65537, 13, 1114102, 65537, 13, 1179638, 65537, 13, 1245174, 65537, 13, 1310710, 65537, 13, 1376246, 65537, 13, 1441782, 65537, 13, 1507318, 65537, 13, 1572854, 655361, 17, 983031, 655361, 17, 1048567, 65537, 13, 1114103, 65537, 13, 1179639, 65537, 13, 1245175, 65537, 13, 1310711, 65537, 13, 1376247, 65537, 13, 1441783, 65537, 13, 1507319, 65537, 13, 1572855, 655361, 17, 983032, 655361, 17, 1048568, 65537, 13, 1114104, 65537, 13, 1179640, 65537, 13, 1245176, 65537, 13, 1310712, 65537, 13, 1376248, 65537, 13, 1441784, 65537, 13, 1507320, 65537, 13, 1572856, 655361, 17, 983033, 655361, 17, 1048569, 65537, 13, 1114105, 65537, 13, 1179641, 65537, 13, 1245177, 65537, 13, 1310713, 65537, 13, 1376249, 65537, 13, 1441785, 65537, 13, 1507321, 65537, 13, 1572857, 655361, 17, 983034, 655361, 17, 1048570, 65537, 13, 1114106, 65537, 13, 1179642, 65537, 13, 1245178, 65537, 13, 1310714, 65537, 13, 1376250, 65537, 13, 1441786, 65537, 13, 1507322, 65537, 13, 1572858, 655361, 17, 983035, 655361, 17, 1048571, 65537, 13, 1114107, 65537, 13, 1179643, 65537, 13, 1245179, 65537, 13, 1310715, 65537, 13, 1376251, 65537, 13, 1441787, 65537, 13, 1507323, 65537, 13, 1572859, 655361, 17, 983036, 655361, 17, 1048572, 65537, 13, 1114108, 65537, 13, 1179644, 65537, 13, 1245180, 65537, 13, 1310716, 65537, 13, 1376252, 65537, 13, 1441788, 65537, 13, 1507324, 65537, 13, 1572860, 655361, 17, 983037, 655361, 17, 1048573, 65537, 13, 1114109, 65537, 13, 1179645, 65537, 13, 1245181, 65537, 13, 1310717, 65537, 13, 1376253, 65537, 13, 1441789, 65537, 13, 1507325, 65537, 13, 1572861, 655361, 17, 983038, 655361, 17, 1048574, 65537, 13, 1114110, 65537, 13, 1179646, 65537, 13, 1245182, 65537, 13, 1310718, 65537, 13, 1376254, 65537, 13, 1441790, 65537, 13, 1507326, 65537, 13, 1572862, 655361, 17, 983039, 655361, 17, 1048575, 65537, 13, 1114111, 655361, 18, 1179647, 655361, 18, 1245183, 655361, 18, 1310719, 655361, 18, 1376255, 655361, 18, 1441791, 655361, 18, 1507327, 655361, 18, 1572863, 655361, 17, 983027, 65537, 13) + +[node name="SceneTransition" parent="." instance=ExtResource("3_n745i")] +position = Vector2(-200, 224) +sceneFilePath = "res://Scenes/Maps/World2.tscn" +targetPlayerPositionNodePath = "PlayerPositionWorld1-1" + +[node name="PlayerPositionWorld2-1" type="Node2D" parent="."] +position = Vector2(-200, 240) + +[node name="SceneTransition2" parent="." instance=ExtResource("3_n745i")] +position = Vector2(152, 384) +sceneFilePath = "res://Scenes/Maps/World2.tscn" +targetPlayerPositionNodePath = "PlayerPositionWorld1-2" + +[node name="PlayerPositionWorld2-2" parent="." instance=ExtResource("6_tmdwn")] +position = Vector2(152, 368) + +[node name="InitialPlayerPosition" type="Node2D" parent="."] +position = Vector2(64, 256) + +[connection signal="body_entered" from="Areas/MapArea" to="Areas/MapArea" method="_on_body_entered" flags=18] +[connection signal="body_entered" from="Areas/MapArea2" to="Areas/MapArea2" method="_on_body_entered" flags=18] diff --git a/Scenes/Maps/World2.gd b/Scenes/Maps/World2.gd new file mode 100644 index 0000000..89e9209 --- /dev/null +++ b/Scenes/Maps/World2.gd @@ -0,0 +1 @@ +extends "res://Scenes/Maps/Map.gd" diff --git a/Scenes/Maps/World2.tscn b/Scenes/Maps/World2.tscn new file mode 100644 index 0000000..216c4ce --- /dev/null +++ b/Scenes/Maps/World2.tscn @@ -0,0 +1,52 @@ +[gd_scene load_steps=7 format=3 uid="uid://civ6kmtrcb1cu"] + +[ext_resource type="Script" path="res://Scenes/Maps/World2.gd" id="1_aucep"] +[ext_resource type="PackedScene" uid="uid://difwuijv2rlx5" path="res://Scenes/Components/MapArea.tscn" id="1_iggh6"] +[ext_resource type="PackedScene" uid="uid://cluuq4bwb8ebs" path="res://Scenes/Components/PlayerPosition.tscn" id="2_tjoos"] +[ext_resource type="PackedScene" uid="uid://c5ix2njry0181" path="res://Scenes/Components/SceneTransition.tscn" id="3_rtmo8"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_ps5ac"] +size = Vector2(240, 160) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_e0tjv"] +size = Vector2(240, 160) + +[node name="World2" type="Node2D"] +script = ExtResource("1_aucep") + +[node name="MapArea" parent="." instance=ExtResource("1_iggh6")] + +[node name="TileMap" parent="MapArea" index="1"] +layer_0/tile_data = PackedInt32Array(0, 655361, 18, 65536, 655361, 18, 131072, 655361, 18, 196608, 655361, 18, 262144, 655361, 18, 327680, 655361, 18, 393216, 655361, 18, 458752, 655361, 18, 524288, 655361, 18, 589824, 655361, 17, 1, 655361, 17, 65537, 1, 13, 131073, 1, 13, 196609, 1, 13, 262145, 1, 13, 327681, 1, 13, 393217, 1, 13, 458753, 1, 13, 524289, 1, 13, 589825, 655361, 17, 2, 655361, 17, 65538, 1, 13, 131074, 1, 13, 196610, 1, 13, 262146, 1, 13, 327682, 1, 13, 393218, 1, 13, 458754, 1, 13, 524290, 1, 13, 3, 655361, 17, 65539, 1, 13, 131075, 1, 13, 196611, 1, 13, 262147, 1, 13, 327683, 1, 13, 393219, 1, 13, 458755, 1, 13, 524291, 1, 13, 589827, 655361, 17, 4, 655361, 17, 65540, 1, 13, 131076, 1, 13, 196612, 1, 13, 262148, 1, 13, 327684, 1, 13, 393220, 1, 13, 458756, 1, 13, 524292, 1, 13, 589828, 655361, 17, 5, 655361, 17, 65541, 1, 13, 131077, 1, 13, 196613, 1, 13, 262149, 1, 13, 327685, 1, 13, 393221, 1, 13, 458757, 1, 13, 524293, 1, 13, 589829, 655361, 17, 6, 655361, 17, 65542, 1, 13, 131078, 1, 13, 196614, 1, 13, 262150, 1, 13, 327686, 1, 13, 393222, 1, 13, 458758, 1, 13, 524294, 1, 13, 589830, 655361, 17, 7, 655361, 17, 65543, 1, 13, 131079, 1, 13, 196615, 1, 13, 262151, 1, 13, 327687, 1, 13, 393223, 1, 13, 458759, 1, 13, 524295, 1, 13, 589831, 655361, 17, 8, 655361, 17, 65544, 1, 13, 131080, 1, 13, 196616, 1, 13, 262152, 1, 13, 327688, 1, 13, 393224, 1, 13, 458760, 1, 13, 524296, 1, 13, 589832, 655361, 17, 9, 655361, 17, 65545, 1, 13, 131081, 1, 13, 196617, 1, 13, 262153, 1, 13, 327689, 1, 13, 393225, 1, 13, 458761, 1, 13, 524297, 1, 13, 589833, 655361, 17, 10, 655361, 17, 65546, 1, 13, 131082, 1, 13, 196618, 1, 13, 262154, 1, 13, 327690, 1, 13, 393226, 1, 13, 458762, 1, 13, 524298, 1, 13, 589834, 655361, 17, 11, 655361, 17, 65547, 1, 13, 131083, 1, 13, 196619, 1, 13, 262155, 1, 13, 327691, 1, 13, 393227, 1, 13, 458763, 1, 13, 524299, 1, 13, 589835, 655361, 17, 12, 655361, 17, 65548, 1, 13, 131084, 1, 13, 196620, 1, 13, 262156, 1, 13, 327692, 1, 13, 393228, 1, 13, 458764, 1, 13, 524300, 1, 13, 589836, 655361, 17, 13, 655361, 17, 65549, 1, 13, 131085, 1, 13, 196621, 1, 13, 262157, 1, 13, 327693, 1, 13, 393229, 1, 13, 458765, 1, 13, 524301, 1, 13, 589837, 655361, 17, 14, 655361, 18, 65550, 655361, 17, 131086, 1, 13, 196622, 655361, 18, 262158, 655361, 18, 327694, 655361, 18, 393230, 655361, 18, 458766, 655361, 18, 524302, 655361, 18, 589838, 655361, 17, 589826, 1, 13) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="MapArea"] +position = Vector2(120, 80) +shape = SubResource("RectangleShape2D_ps5ac") + +[node name="MapArea2" parent="." instance=ExtResource("1_iggh6")] + +[node name="TileMap" parent="MapArea2" index="1"] +layer_0/tile_data = PackedInt32Array(15, 655361, 18, 65551, 655361, 17, 131087, 1, 13, 196623, 655361, 18, 262159, 655361, 18, 327695, 655361, 18, 393231, 655361, 18, 458767, 655361, 18, 524303, 655361, 18, 589839, 655361, 17, 16, 655361, 17, 65552, 1, 13, 131088, 1, 13, 196624, 1, 13, 262160, 1, 13, 327696, 1, 13, 393232, 1, 13, 458768, 1, 13, 524304, 1, 13, 589840, 655361, 17, 65553, 1, 13, 131089, 1, 13, 196625, 1, 13, 262161, 1, 13, 327697, 1, 13, 393233, 1, 13, 458769, 1, 13, 524305, 1, 13, 589841, 655361, 17, 18, 655361, 17, 65554, 1, 13, 131090, 1, 13, 196626, 1, 13, 262162, 1, 13, 327698, 1, 13, 393234, 1, 13, 458770, 1, 13, 524306, 1, 13, 589842, 655361, 17, 19, 655361, 17, 65555, 1, 13, 131091, 1, 13, 196627, 1, 13, 262163, 1, 13, 327699, 1, 13, 393235, 1, 13, 458771, 1, 13, 524307, 1, 13, 589843, 655361, 17, 20, 655361, 17, 65556, 1, 13, 131092, 1, 13, 196628, 1, 13, 262164, 1, 13, 327700, 1, 13, 393236, 1, 13, 458772, 1, 13, 524308, 1, 13, 589844, 655361, 17, 21, 655361, 17, 65557, 1, 13, 131093, 1, 13, 196629, 1, 13, 262165, 1, 13, 327701, 1, 13, 393237, 1, 13, 458773, 1, 13, 524309, 1, 13, 589845, 655361, 17, 22, 655361, 17, 65558, 1, 13, 131094, 1, 13, 196630, 1, 13, 262166, 1, 13, 327702, 1, 13, 393238, 1, 13, 458774, 1, 13, 524310, 1, 13, 23, 655361, 17, 65559, 1, 13, 131095, 1, 13, 196631, 1, 13, 262167, 1, 13, 327703, 1, 13, 393239, 1, 13, 458775, 1, 13, 524311, 1, 13, 589847, 655361, 17, 24, 655361, 17, 65560, 1, 13, 131096, 1, 13, 196632, 1, 13, 262168, 1, 13, 327704, 1, 13, 393240, 1, 13, 458776, 1, 13, 524312, 1, 13, 589848, 655361, 17, 25, 655361, 17, 65561, 1, 13, 131097, 1, 13, 196633, 1, 13, 262169, 1, 13, 327705, 1, 13, 393241, 1, 13, 458777, 1, 13, 524313, 1, 13, 589849, 655361, 17, 26, 655361, 17, 65562, 1, 13, 131098, 1, 13, 196634, 1, 13, 262170, 1, 13, 327706, 1, 13, 393242, 1, 13, 458778, 1, 13, 524314, 1, 13, 589850, 655361, 17, 27, 655361, 17, 65563, 1, 13, 131099, 1, 13, 196635, 1, 13, 262171, 1, 13, 327707, 1, 13, 393243, 1, 13, 458779, 1, 13, 524315, 1, 13, 589851, 655361, 17, 28, 655361, 17, 65564, 1, 13, 131100, 1, 13, 196636, 1, 13, 262172, 1, 13, 327708, 1, 13, 393244, 1, 13, 458780, 1, 13, 524316, 1, 13, 589852, 655361, 17, 29, 655361, 18, 65565, 655361, 18, 131101, 655361, 18, 196637, 655361, 18, 262173, 655361, 18, 327709, 655361, 18, 393245, 655361, 18, 458781, 655361, 18, 524317, 655361, 18, 589853, 655361, 17, 589846, 655361, 17, 17, 1, 13) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="MapArea2"] +position = Vector2(360, 80) +shape = SubResource("RectangleShape2D_e0tjv") + +[node name="PlayerPositionWorld1-1" parent="." instance=ExtResource("2_tjoos")] +position = Vector2(40, 144) + +[node name="PlayerPositionWorld1-2" parent="." instance=ExtResource("2_tjoos")] +position = Vector2(280, 16) + +[node name="SceneTransition" parent="." instance=ExtResource("3_rtmo8")] +position = Vector2(40, 160) +sceneFilePath = "res://Scenes/Maps/World.tscn" +targetPlayerPositionNodePath = "PlayerPositionWorld2-1" + +[node name="SceneTransition2" parent="." instance=ExtResource("3_rtmo8")] +position = Vector2(280, 0) +sceneFilePath = "res://Scenes/Maps/World.tscn" +targetPlayerPositionNodePath = "PlayerPositionWorld2-2" + +[editable path="MapArea"] +[editable path="MapArea2"] diff --git a/Scenes/Start.gd b/Scenes/Start.gd new file mode 100644 index 0000000..0109937 --- /dev/null +++ b/Scenes/Start.gd @@ -0,0 +1,9 @@ +extends Node + + +func _ready(): + var scene = preload("res://Scenes/Maps/World.tscn").instantiate() + var player = preload("res://Scenes/Entities/Player.tscn").instantiate() + Utilities.change_scene_with_player_to_position( + scene, player, NodePath("InitialPlayerPosition") + ) diff --git a/Scenes/Start.tscn b/Scenes/Start.tscn new file mode 100644 index 0000000..668aa36 --- /dev/null +++ b/Scenes/Start.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=3 uid="uid://couei08d5633o"] + +[ext_resource type="Script" path="res://Scenes/Start.gd" id="1_n8geo"] + +[node name="Start" type="Node"] +script = ExtResource("1_n8geo") diff --git a/Scenes/UI/Health.gd b/Scenes/UI/Health.gd new file mode 100644 index 0000000..eb88522 --- /dev/null +++ b/Scenes/UI/Health.gd @@ -0,0 +1,41 @@ +extends Control + + +@export var color_full: Color = Color(1, 0, 0, 1) +@export var color_empty: Color = Color(0, 0, 0, 1) +@export var color_extra_full: Color = Color(1, 1, 0, 1) +@export var color_extra_empty: Color = Color(0, 0, 0, 0) + + +func set_full(): + self.set_color_all(self.color_full) + + +func set_empty(): + self.set_color_all(self.color_empty) + + +func set_full_parts(parts: int): + self.set_empty() + for i in range(1, parts+1): + self.set_color(i, self.color_full) + + +func set_extra_full(): + self.set_color_all(self.color_extra_full) + + +func set_extra_full_parts(parts: int): + self.set_color_all(self.color_extra_empty) + for i in range(1, parts+1): + self.set_color(i, self.color_extra_full) + + +func set_color(index: int, color: Color): + var color_rect: ColorRect = get_node("ColorRect" + str(index)) + color_rect.set_color(color) + + +func set_color_all(color: Color): + for i in range(1, 4+1): + self.set_color(i, color) diff --git a/Scenes/UI/Health.tscn b/Scenes/UI/Health.tscn new file mode 100644 index 0000000..c0c6b76 --- /dev/null +++ b/Scenes/UI/Health.tscn @@ -0,0 +1,42 @@ +[gd_scene load_steps=2 format=3 uid="uid://cd3dyvl10j0wa"] + +[ext_resource type="Script" path="res://Scenes/UI/Health.gd" id="1_6m5ll"] + +[node name="GridContainer" type="Control"] +custom_minimum_size = Vector2(8, 8) +layout_mode = 3 +anchors_preset = 0 +offset_right = 8.0 +offset_bottom = 8.0 +size_flags_horizontal = 12 +size_flags_vertical = 12 +script = ExtResource("1_6m5ll") +color_full = Color(0.862745, 0, 0, 1) + +[node name="ColorRect1" type="ColorRect" parent="."] +custom_minimum_size = Vector2(4, 4) +layout_mode = 2 +offset_right = 2.0 +offset_bottom = 2.0 + +[node name="ColorRect2" type="ColorRect" parent="."] +custom_minimum_size = Vector2(4, 4) +layout_mode = 2 +offset_top = 4.0 +offset_right = 4.0 +offset_bottom = 8.0 + +[node name="ColorRect3" type="ColorRect" parent="."] +custom_minimum_size = Vector2(4, 4) +layout_mode = 2 +offset_left = 4.0 +offset_top = 4.0 +offset_right = 8.0 +offset_bottom = 8.0 + +[node name="ColorRect4" type="ColorRect" parent="."] +custom_minimum_size = Vector2(4, 4) +layout_mode = 2 +offset_left = 4.0 +offset_right = 8.0 +offset_bottom = 4.0 diff --git a/Scenes/UI/HealthBar.gd b/Scenes/UI/HealthBar.gd new file mode 100644 index 0000000..8c4c90d --- /dev/null +++ b/Scenes/UI/HealthBar.gd @@ -0,0 +1,44 @@ +extends Control + + +var Health = preload("res://Scenes/UI/Health.tscn") +var player: Player + + +func connect_to_player(player_to_connect: Player): + self.player = player_to_connect + self.draw_health() + + self.player.connect("damaged", func (_health): self.draw_health()) + + +func draw_health(): + for child in $HBoxContainer.get_children(): + child.queue_free() + + for i in int(player.health / 4.0): + var healthNode = Health.instantiate() + healthNode.set_full() + $HBoxContainer.add_child(healthNode) + + if player.health % 4 > 0: + var healthNode = Health.instantiate() + healthNode.set_full_parts(player.health % 4) + $HBoxContainer.add_child(healthNode) + + var health_diff = player.maxHealth - player.health + for i in int(health_diff / 4.0): + var healthNode = Health.instantiate() + healthNode.set_empty() + $HBoxContainer.add_child(healthNode) + + if player.extraHealth > 0: + for i in int(player.extraHealth / 4.0): + var healthNode = Health.instantiate() + healthNode.set_extra_full() + $HBoxContainer.add_child(healthNode) + + if player.extraHealth % 4 > 0: + var healthNode = Health.instantiate() + healthNode.set_extra_full_parts(player.extraHealth % 4) + $HBoxContainer.add_child(healthNode) diff --git a/Scenes/UI/HealthBar.tscn b/Scenes/UI/HealthBar.tscn new file mode 100644 index 0000000..6335714 --- /dev/null +++ b/Scenes/UI/HealthBar.tscn @@ -0,0 +1,15 @@ +[gd_scene load_steps=2 format=3 uid="uid://buju4hh2nrrvs"] + +[ext_resource type="Script" path="res://Scenes/UI/HealthBar.gd" id="1_t85yh"] + +[node name="HealthBar" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_t85yh") + +[node name="HBoxContainer" type="HBoxContainer" parent="."] +layout_mode = 1 diff --git a/Scenes/UI/Menu.gd b/Scenes/UI/Menu.gd new file mode 100644 index 0000000..b482342 --- /dev/null +++ b/Scenes/UI/Menu.gd @@ -0,0 +1,65 @@ +extends TabContainer + + +func _ready(): + hide() + + +func _input(_event: InputEvent): + if Input.is_action_just_pressed("ui_menu"): + if get_tree().paused: # game is paused + self.close_menu() + else: # game is running + self.open_menu() + + if Input.is_action_pressed("ui_menu_left"): + if get_current_tab() > 0: + set_current_tab(get_current_tab() - 1) + if Input.is_action_pressed("ui_menu_right"): + if get_current_tab() < get_tab_count() - 1: + set_current_tab(get_current_tab() + 1) + + +func open_menu(): + get_tree().paused = true + show() + + +func close_menu(): + hide() + get_tree().paused = false + + +func get_player(): + return get_tree().get_current_scene().get_node("Player") + + +### Bombs ### + + +func _on_button_bomb_normal_pressed(): + self.get_player().Bomb = preload("res://Scenes/Entities/Bombs/Bomb__Normal.tscn") + + +func _on_button_bomb_breakables_pressed(): + self.get_player().Bomb = preload("res://Scenes/Entities/Bombs/Bomb__Breakables.tscn") + + +func _on_bomb_power_item_selected(index): + var power = int($Bombs/Panel/HBoxContainer/VBoxContainer2/BombPower.get_item_text(index)) + self.get_player().bomb_power = power + + +### System ### + + +func quit_game(): + get_tree().quit() + + +func _on_button_resume_pressed(): + self.close_menu() + + +func _on_button_quit_pressed(): + self.quit_game() diff --git a/Scenes/UI/Menu.tscn b/Scenes/UI/Menu.tscn new file mode 100644 index 0000000..4a8f26e --- /dev/null +++ b/Scenes/UI/Menu.tscn @@ -0,0 +1,130 @@ +[gd_scene load_steps=8 format=3 uid="uid://d3xrwsv32hs6k"] + +[ext_resource type="Script" path="res://Scenes/UI/Menu.gd" id="1_vwah3"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_flq5r"] +bg_color = Color(0, 0, 0, 0.784314) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_u0ugs"] +bg_color = Color(0, 0, 0, 0.784314) + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_p483f"] + +[sub_resource type="LabelSettings" id="LabelSettings_3ht7i"] +font_size = 10 + +[sub_resource type="LabelSettings" id="LabelSettings_s4847"] +font_size = 10 + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_7at3v"] + +[node name="TabContainer" type="TabContainer"] +process_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_font_sizes/font_size = 10 +theme_override_styles/panel = SubResource("StyleBoxFlat_flq5r") +theme_override_styles/tabbar_background = SubResource("StyleBoxFlat_u0ugs") +clip_tabs = false +script = ExtResource("1_vwah3") + +[node name="Bombs" type="MarginContainer" parent="."] +layout_mode = 2 +theme_override_constants/margin_left = 8 +theme_override_constants/margin_top = 8 +theme_override_constants/margin_right = 8 +theme_override_constants/margin_bottom = 8 + +[node name="Panel" type="Panel" parent="Bombs"] +layout_mode = 2 +theme_override_styles/panel = SubResource("StyleBoxEmpty_p483f") + +[node name="HBoxContainer" type="HBoxContainer" parent="Bombs/Panel"] +layout_mode = 1 +offset_right = 177.0 +offset_bottom = 101.0 + +[node name="VBoxContainer" type="VBoxContainer" parent="Bombs/Panel/HBoxContainer"] +layout_mode = 2 + +[node name="Label" type="Label" parent="Bombs/Panel/HBoxContainer/VBoxContainer"] +layout_mode = 2 +text = "Type" +label_settings = SubResource("LabelSettings_3ht7i") +horizontal_alignment = 1 + +[node name="ButtonBombNormal" type="Button" parent="Bombs/Panel/HBoxContainer/VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 10 +text = "Normal" + +[node name="ButtonBombBreakables" type="Button" parent="Bombs/Panel/HBoxContainer/VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 10 +text = "Breakables" + +[node name="Space" type="Control" parent="Bombs/Panel/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="VBoxContainer2" type="VBoxContainer" parent="Bombs/Panel/HBoxContainer"] +layout_mode = 2 + +[node name="Label" type="Label" parent="Bombs/Panel/HBoxContainer/VBoxContainer2"] +layout_mode = 2 +text = "Power" +label_settings = SubResource("LabelSettings_s4847") +horizontal_alignment = 1 + +[node name="BombPower" type="ItemList" parent="Bombs/Panel/HBoxContainer/VBoxContainer2"] +layout_mode = 2 +theme_override_font_sizes/font_size = 10 +auto_height = true +item_count = 4 +item_0/text = "2" +item_1/text = "3" +item_2/text = "4" +item_3/text = "5" + +[node name="System" type="MarginContainer" parent="."] +visible = false +layout_mode = 2 +theme_override_constants/margin_left = 16 +theme_override_constants/margin_top = 16 +theme_override_constants/margin_right = 16 +theme_override_constants/margin_bottom = 16 + +[node name="Panel" type="Panel" parent="System"] +layout_mode = 2 +theme_override_styles/panel = SubResource("StyleBoxEmpty_7at3v") + +[node name="VBoxContainer" type="VBoxContainer" parent="System/Panel"] +layout_mode = 1 +anchors_preset = 3 +anchor_left = 1.0 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = -92.0 +offset_top = -48.0 +grow_horizontal = 0 +grow_vertical = 0 + +[node name="ButtonResume" type="Button" parent="System/Panel/VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 10 +text = "Resume Game" + +[node name="ButtonQuit" type="Button" parent="System/Panel/VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 10 +text = "Quit Game" + +[connection signal="pressed" from="Bombs/Panel/HBoxContainer/VBoxContainer/ButtonBombNormal" to="." method="_on_button_bomb_normal_pressed"] +[connection signal="pressed" from="Bombs/Panel/HBoxContainer/VBoxContainer/ButtonBombBreakables" to="." method="_on_button_bomb_breakables_pressed"] +[connection signal="item_selected" from="Bombs/Panel/HBoxContainer/VBoxContainer2/BombPower" to="." method="_on_bomb_power_item_selected"] +[connection signal="pressed" from="System/Panel/VBoxContainer/ButtonResume" to="." method="_on_button_resume_pressed"] +[connection signal="pressed" from="System/Panel/VBoxContainer/ButtonQuit" to="." method="_on_button_quit_pressed"] diff --git a/Scenes/Utilities.gd b/Scenes/Utilities.gd new file mode 100644 index 0000000..f9485ff --- /dev/null +++ b/Scenes/Utilities.gd @@ -0,0 +1,142 @@ +extends Node + + +const TILE_SIZE = 16 +const SCREEN_FADE_DURATION = 0.25 + + +func get_level_position(scene) -> Vector2: + return self.from_position_to_grid(scene.position) + #var x = floor(scene.position.x / 16) + #var y = floor(scene.position.y / 16) + + #return Vector2(x, y) + + +func get_level_position_grid(scene) -> Vector2: + return self.from_grid_to_position(self.from_position_to_grid(scene.position)) + #return (self.get_level_position(scene) * self.TILE_SIZE) + Vector2(self.TILE_SIZE / 2, self.TILE_SIZE / 2) + + +func from_position_to_grid(position: Vector2) -> Vector2: + return floor(position / self.TILE_SIZE) + + +func from_grid_to_position(grid_position: Vector2) -> Vector2: + return (grid_position * self.TILE_SIZE) + Vector2(self.TILE_SIZE / 2.0, self.TILE_SIZE / 2.0) + + +func change_scene(scene): + get_tree().root.add_child(scene) + get_tree().current_scene.queue_free() + get_tree().current_scene = scene + + +func change_scene_with_fade(scene): + self.change_scene(scene) + self.fade_screen(Color(0, 0, 0, 1), Color(0, 0, 0, 0)) + + +func change_scene_with_player_to_position( + scene: Node2D, player: Player, targetPlayerPositionNodePath: NodePath +): + Global.player = player + Global.last_area = null + + var targetPlayerPositionNode = scene.get_node(targetPlayerPositionNodePath) + player.position = targetPlayerPositionNode.position + scene.add_child(player) + + call_deferred("change_scene_with_fade", scene) + + +func fade_screen(from: Color, to: Color, duration: float = SCREEN_FADE_DURATION) -> Tween: + var canvas = CanvasLayer.new() + var rect = ColorRect.new() + rect.color = from + rect.size = get_viewport().get_visible_rect().size + canvas.add_child(rect) + get_tree().root.add_child(canvas) + + Global.player.set_process(false) + var tween = get_tree().create_tween() + tween.tween_property(rect, "color", to, duration) + tween.tween_callback(func(): + get_tree().root.remove_child(canvas) + Global.player.set_process(true) + ) + + return tween + + +func get_collision_shape_bounds(collision_shape: CollisionShape2D): + var shape: Shape2D = collision_shape.shape + var bounds + + if shape is RectangleShape2D: + bounds = Rect2( + collision_shape.position - shape.get_rect().size/2, + shape.get_rect().size + ) + + return bounds + + +func add_collision_area(node: Node2D, original_collision_shape: Node2D): + var collision_area = Collision.Area.new(node, original_collision_shape) + + # add area to node + node.add_child(collision_area) + + return collision_area + + +class Collision: + class Area extends Area2D: + signal collided + + func _init(node: Node2D, original_collision_shape: Node2D, expand: bool = true): + self.name = "CollisionArea" + super() + + # setup area + self.collision_layer = node.collision_layer + self.collision_mask = node.collision_mask + + for group in node.get_groups(): + self.add_to_group(group) + + self.connect("area_entered", func(area): emit_signal("collided", area)) + + # copy shape and expand it + var collision_shape = original_collision_shape.duplicate() + if collision_shape is CollisionShape2D: + var shape = collision_shape.shape.duplicate() + + if expand: + if shape is RectangleShape2D: + shape.set_size(shape.get_size() + Vector2(1, 1)) + elif shape is CapsuleShape2D: + shape.set_height(shape.get_height() + 1) + shape.set_radius(shape.get_radius() + 1) + + collision_shape.set_shape(shape) + + elif collision_shape is CollisionPolygon2D: + var polygon = collision_shape.polygon.duplicate() + + if expand: + pass + + collision_shape.set_polygon(polygon) + pass + + self.add_child(collision_shape) + + + class Layer: + const PLAYER = 2 + const BOMB = 3 + const SOLID = 4 + const ENEMY = 5 + const EXPLOSION = 6 |