diff --git a/scenes/finish.tscn b/scenes/finish.tscn deleted file mode 100644 index d1297b6..0000000 --- a/scenes/finish.tscn +++ /dev/null @@ -1,19 +0,0 @@ -[gd_scene load_steps=2 format=3 uid="uid://dil6xu7d13gaa"] - -[ext_resource type="FontFile" uid="uid://byk2mu442w6h6" path="res://assets/fonts/PixelOperator8.ttf" id="2_hkvp3"] - -[node name="Menu" type="Node2D"] - -[node name="Camera2D" type="Camera2D" parent="."] -zoom = Vector2(4, 4) - -[node name="Label" type="Label" parent="."] -offset_left = -71.0 -offset_top = -4.0 -offset_right = 70.0 -offset_bottom = 4.0 -theme_override_fonts/font = ExtResource("2_hkvp3") -theme_override_font_sizes/font_size = 8 -text = "THANK YOU FOR PLAYING!" -horizontal_alignment = 1 -vertical_alignment = 1 diff --git a/scenes/level2.tscn b/scenes/level2.tscn index d0b8d3d..3ed8403 100644 --- a/scenes/level2.tscn +++ b/scenes/level2.tscn @@ -557,6 +557,14 @@ position = Vector2(552, 1) [node name="Coin6" parent="Coins" instance=ExtResource("7_5j2nn")] position = Vector2(552, 150) +[node name="Slimes" type="Node" parent="."] + +[node name="Slime" parent="Slimes" instance=ExtResource("8_l6cxp")] +position = Vector2(488, 160) + +[node name="Slime2" parent="Slimes" instance=ExtResource("8_l6cxp")] +position = Vector2(775, 160) + [node name="Labels" type="Node" parent="."] [node name="Label" type="Label" parent="Labels"] @@ -585,10 +593,4 @@ collision_mask = 2 position = Vector2(1112, -23) shape = SubResource("RectangleShape2D_vesyn") -[node name="Slime" parent="." instance=ExtResource("8_l6cxp")] -position = Vector2(488, 160) - -[node name="Slime2" parent="." instance=ExtResource("8_l6cxp")] -position = Vector2(775, 160) - [connection signal="body_entered" from="Finish" to="Player" method="_on_change_scene_body_entered"] diff --git a/scenes/level3.tscn b/scenes/level3.tscn index 0d125a1..94df493 100644 --- a/scenes/level3.tscn +++ b/scenes/level3.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=12 format=3 uid="uid://bbwynr6uj2fdw"] +[gd_scene load_steps=11 format=3 uid="uid://bbwynr6uj2fdw"] [ext_resource type="Script" path="res://scripts/game_manager.gd" id="1_8tnfi"] [ext_resource type="Texture2D" uid="uid://bcrfccy8xfpky" path="res://assets/sprites/world_tileset.png" id="2_skfhp"] @@ -415,9 +415,6 @@ sources/0 = SubResource("TileSetAtlasSource_2r6u8") [sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_cib0o"] distance = -80.0 -[sub_resource type="RectangleShape2D" id="RectangleShape2D_cjdwt"] -size = Vector2(14, 14) - [node name="Game" type="Node2D"] [node name="GameManager" type="Node" parent="."] @@ -447,7 +444,7 @@ layer_1/tile_data = PackedInt32Array(65530, 262144, 0, 65531, 262144, 0, 65532, [node name="Player" parent="." instance=ExtResource("3_2jy7s")] z_index = 5 -position = Vector2(1077, -101) +position = Vector2(1057, -83) [node name="Camera2D" type="Camera2D" parent="Player"] position = Vector2(1, -8) @@ -519,12 +516,3 @@ position = Vector2(690, -32) [node name="Slime7" parent="Slime" instance=ExtResource("7_bsb3u")] position = Vector2(906, -48) - -[node name="Finish" type="Area2D" parent="."] -collision_mask = 2 - -[node name="CollisionShape2D" type="CollisionShape2D" parent="Finish"] -position = Vector2(1112, -23) -shape = SubResource("RectangleShape2D_cjdwt") - -[connection signal="body_entered" from="Finish" to="Player" method="_on_finish_body_entered"] diff --git a/scenes/slime.tscn b/scenes/slime.tscn index 4d0e1d5..75803f5 100644 --- a/scenes/slime.tscn +++ b/scenes/slime.tscn @@ -65,11 +65,11 @@ shape = SubResource("RectangleShape2D_4isun") one_way_collision_margin = 0.0 [node name="RayCastRight" type="RayCast2D" parent="."] -position = Vector2(0, -6) +position = Vector2(1, -6) target_position = Vector2(10, 0) [node name="RayCastLeft" type="RayCast2D" parent="."] -position = Vector2(0, -6) +position = Vector2(-1, -6) target_position = Vector2(-10, 0) [node name="EnemyKill" type="Area2D" parent="."] diff --git a/scripts/player.gd b/scripts/player.gd index 6ca8158..3a32cbd 100644 --- a/scripts/player.gd +++ b/scripts/player.gd @@ -5,9 +5,6 @@ const JUMP_VELOCITY := -280.0 const GRAVITY := 1000 const FALL_GRAVITY := 1500 -# Get the input direction: -1, 0, 1 -var direction := Input.get_axis("move_left", "move_right") - @onready var animated_sprite: AnimatedSprite2D = $AnimatedSprite2D @onready var jump: AudioStreamPlayer2D = $Jump @@ -25,7 +22,7 @@ func _physics_process(delta: float) -> void: jump.play(0) # Get the input direction: -1, 0, 1 - var direction: int = Input.get_axis("move_left", "move_right") + var direction := Input.get_axis("move_left", "move_right") # Flip the Sprite if direction > 0: @@ -56,13 +53,8 @@ func get_gravity() -> int: return GRAVITY return FALL_GRAVITY -func _on_area_2d_body_entered(body: Node) -> void: +func _on_area_2d_body_entered() -> void: get_tree().change_scene_to_file("res://scenes/level2.tscn") - -func _on_change_scene_body_entered(body: Node) -> void: +func _on_change_scene_body_entered() -> void: get_tree().change_scene_to_file("res://scenes/level3.tscn") - - -func _on_finish_body_entered(body: Node) -> void: - get_tree().change_scene_to_file("res://scenes/finish.tscn") diff --git a/scripts/slime.gd b/scripts/slime.gd index 595a624..633be8a 100644 --- a/scripts/slime.gd +++ b/scripts/slime.gd @@ -18,6 +18,6 @@ func _process(delta: float) -> void: animated_sprite.flip_h = false position.x += direction * SPEED * delta -func _on_enemy_kill_body_entered(body: Node) -> void: +func _on_enemy_kill_body_entered() -> void: #sound_manager.playmobDeathSound() self.queue_free()