diff --git a/Objects/Laser.gd b/Objects/Laser.gd index eb60898..b178575 100644 --- a/Objects/Laser.gd +++ b/Objects/Laser.gd @@ -29,3 +29,7 @@ func _physics_process(delta): $Beam/End.global_position = point $Beam/RecreatingRectangleShape.shape.extents.y = (length / 2) + 10 $Beam/RecreatingRectangleShape.position.y = (length / 2) - 5 + + +func _on_Beam_body_entered(body): + body.die() diff --git a/Objects/Laser.tscn b/Objects/Laser.tscn index 0a2dfbe..8134b30 100644 --- a/Objects/Laser.tscn +++ b/Objects/Laser.tscn @@ -6,11 +6,12 @@ [ext_resource path="res://Sprites/laser_beam_continuous.png" type="Texture" id=4] [ext_resource path="res://Objects/ScrollingObjects/Utilities/RecreatingRectangleShape.tscn" type="PackedScene" id=5] - [node name="Laser" type="Node2D"] script = ExtResource( 2 ) [node name="Beam" type="Area2D" parent="."] +collision_layer = 8 +collision_mask = 2 [node name="Raycast" type="RayCast2D" parent="Beam"] visible = false @@ -41,3 +42,4 @@ centered = false [node name="Sprite" type="Sprite" parent="Gun"] position = Vector2( 0, -40 ) texture = ExtResource( 1 ) +[connection signal="body_entered" from="Beam" to="." method="_on_Beam_body_entered"] diff --git a/Objects/Levels/BuzzsawChoice.tscn b/Objects/Levels/BuzzsawChoice.tscn index cc87d74..cf11cbd 100644 --- a/Objects/Levels/BuzzsawChoice.tscn +++ b/Objects/Levels/BuzzsawChoice.tscn @@ -9,7 +9,7 @@ [ext_resource path="res://Objects/ScrollingObjects/Buttons/CBSpeedChangeButton.tscn" type="PackedScene" id=12] [node name="BuzzsawChoice" type="Node2D"] -position = Vector2( 3800, 0 ) +position = Vector2( 280, 0 ) [node name="Buzzsaw4" parent="." instance=ExtResource( 8 )] position = Vector2( -120, 600 ) @@ -85,7 +85,7 @@ position = Vector2( 480, 0 ) is_active = false [node name="CBSpeedChangeButton" parent="." instance=ExtResource( 12 )] -position = Vector2( 380, 580 ) +position = Vector2( -260, 620 ) color = Color( 0.7, 1, 0.7, 1 ) icon = ExtResource( 4 ) change = 20.0 diff --git a/Objects/Levels/Toggles.tscn b/Objects/Levels/Toggles.tscn index 9a41332..c98d67d 100644 --- a/Objects/Levels/Toggles.tscn +++ b/Objects/Levels/Toggles.tscn @@ -1,218 +1,123 @@ -[gd_scene load_steps=12 format=2] +[gd_scene load_steps=7 format=2] -[ext_resource path="res://Tilesets/Pipes.tres" type="TileSet" id=1] -[ext_resource path="res://Objects/ScrollingObjects/Ghosts/GhostBlock.gd" type="Script" id=2] -[ext_resource path="res://Objects/ScrollingObjects/Ghosts/GhostGroup.gd" type="Script" id=3] [ext_resource path="res://Objects/ScrollingObjects/Loop.tscn" type="PackedScene" id=4] [ext_resource path="res://Objects/ScrollingObjects/Buttons/GameButton.tscn" type="PackedScene" id=5] [ext_resource path="res://Objects/ScrollingObjects/Ghosts/GhostGroup.tscn" type="PackedScene" id=6] -[ext_resource path="res://Objects/ScrollingObjects/Buttons/GameButton.gd" type="Script" id=7] -[ext_resource path="res://Objects/ScrollingObjects/Loop.gd" type="Script" id=8] [ext_resource path="res://Objects/ScrollingObjects/Utilities/ScrollingPipesTileMap.tscn" type="PackedScene" id=9] [ext_resource path="res://Objects/ScrollingObjects/ScrollingPipe.tscn" type="PackedScene" id=10] [ext_resource path="res://Objects/ScrollingObjects/Ghosts/GhostBlock.tscn" type="PackedScene" id=11] [node name="Toggles" type="Node2D"] -position = Vector2( 2400, 0 ) +position = Vector2( 1140, 0 ) -[node name="ScrollingPipe2" type="KinematicBody2D" parent="." instance=ExtResource( 10 )] -collision_layer = 8 -collision_mask = 2 -motion/sync_to_physics = true +[node name="ScrollingPipe2" parent="." instance=ExtResource( 10 )] -[node name="TileMap" type="TileMap" parent="ScrollingPipe2" instance=ExtResource( 9 )] -tile_set = ExtResource( 1 ) -cell_size = Vector2( 40, 40 ) -cell_quadrant_size = 40 -collision_use_kinematic = true -collision_layer = 8 -collision_mask = 2 -format = 1 +[node name="TileMap" parent="ScrollingPipe2" instance=ExtResource( 9 )] tile_data = PoolIntArray( 720877, 0, 65536, 720881, 0, 65536, 720885, 0, 65536, 720889, 0, 0, 720890, 0, 65537, 720891, 0, 65537, 720892, 0, 65537, 720893, 0, 1, 786413, 0, 65536, 786417, 0, 65536, 786421, 0, 65536, 786425, 0, 65536, 786429, 0, 65536, 851948, 0, 0, 851949, 0, 131073, 851953, 0, 65536, 851957, 0, 65536, 851961, 0, 65536, 851965, 0, 65536, 917483, 0, 0, 917484, 0, 131073, 917489, 0, 65536, 917493, 0, 65536, 917497, 0, 65536, 917501, 0, 65536, 983018, 0, 0, 983019, 0, 131073, 983025, 0, 65536, 983029, 0, 65536, 983033, 0, 65536, 983037, 0, 65536, 1048553, 0, 0, 1048554, 0, 131073, 1114088, 0, 0, 1114089, 0, 131073 ) -[node name="Loop5" type="Area2D" parent="." instance=ExtResource( 4 )] +[node name="Loop5" parent="." instance=ExtResource( 4 )] position = Vector2( -580, 380 ) -collision_layer = 32 -collision_mask = 2 -script = ExtResource( 8 ) -[node name="Loop6" type="Area2D" parent="." instance=ExtResource( 4 )] +[node name="Loop6" parent="." instance=ExtResource( 4 )] position = Vector2( -420, 380 ) -collision_layer = 32 -collision_mask = 2 -script = ExtResource( 8 ) -[node name="Loop7" type="Area2D" parent="." instance=ExtResource( 4 )] +[node name="Loop7" parent="." instance=ExtResource( 4 )] position = Vector2( -260, 380 ) -collision_layer = 32 -collision_mask = 2 -script = ExtResource( 8 ) -[node name="Loop17" type="Area2D" parent="." instance=ExtResource( 4 )] +[node name="Loop17" parent="." instance=ExtResource( 4 )] position = Vector2( -100, 380 ) -collision_layer = 32 -collision_mask = 2 -script = ExtResource( 8 ) -[node name="Loop9" type="Area2D" parent="." instance=ExtResource( 4 )] +[node name="Loop9" parent="." instance=ExtResource( 4 )] position = Vector2( -740, 380 ) -collision_layer = 32 -collision_mask = 2 -script = ExtResource( 8 ) -[node name="GhostGroup2" type="Node2D" parent="." instance=ExtResource( 6 )] +[node name="GhostGroup2" parent="." instance=ExtResource( 6 )] position = Vector2( -700, 420 ) -script = ExtResource( 3 ) -[node name="GameButton" type="Area2D" parent="GhostGroup2" instance=ExtResource( 5 )] +[node name="GameButton" parent="GhostGroup2" instance=ExtResource( 5 )] position = Vector2( 200, -160 ) -collision_layer = 8 -collision_mask = 2147483648 -script = ExtResource( 7 ) -[node name="GameButton2" type="Area2D" parent="GhostGroup2" instance=ExtResource( 5 )] +[node name="GameButton2" parent="GhostGroup2" instance=ExtResource( 5 )] position = Vector2( 560, 160 ) -collision_layer = 8 -collision_mask = 2147483648 -script = ExtResource( 7 ) is_active = false -[node name="GhostBlock" type="StaticBody2D" parent="GhostGroup2" instance=ExtResource( 11 )] -script = ExtResource( 2 ) +[node name="GhostBlock" parent="GhostGroup2" instance=ExtResource( 11 )] -[node name="GhostBlock2" type="StaticBody2D" parent="GhostGroup2" instance=ExtResource( 11 )] +[node name="GhostBlock2" parent="GhostGroup2" instance=ExtResource( 11 )] position = Vector2( 40, 0 ) -script = ExtResource( 2 ) -[node name="GhostBlock3" type="StaticBody2D" parent="GhostGroup2" instance=ExtResource( 11 )] +[node name="GhostBlock3" parent="GhostGroup2" instance=ExtResource( 11 )] position = Vector2( 80, 0 ) -script = ExtResource( 2 ) -[node name="GhostBlock4" type="StaticBody2D" parent="GhostGroup2" instance=ExtResource( 11 )] +[node name="GhostBlock4" parent="GhostGroup2" instance=ExtResource( 11 )] position = Vector2( 160, 0 ) -script = ExtResource( 2 ) -[node name="GhostBlock5" type="StaticBody2D" parent="GhostGroup2" instance=ExtResource( 11 )] +[node name="GhostBlock5" parent="GhostGroup2" instance=ExtResource( 11 )] position = Vector2( 200, 0 ) -script = ExtResource( 2 ) -[node name="GhostBlock6" type="StaticBody2D" parent="GhostGroup2" instance=ExtResource( 11 )] +[node name="GhostBlock6" parent="GhostGroup2" instance=ExtResource( 11 )] position = Vector2( 240, 0 ) -script = ExtResource( 2 ) -[node name="GhostBlock7" type="StaticBody2D" parent="GhostGroup2" instance=ExtResource( 11 )] +[node name="GhostBlock7" parent="GhostGroup2" instance=ExtResource( 11 )] position = Vector2( 320, 0 ) -script = ExtResource( 2 ) -[node name="GhostBlock8" type="StaticBody2D" parent="GhostGroup2" instance=ExtResource( 11 )] +[node name="GhostBlock8" parent="GhostGroup2" instance=ExtResource( 11 )] position = Vector2( 360, 0 ) -script = ExtResource( 2 ) -[node name="GhostBlock9" type="StaticBody2D" parent="GhostGroup2" instance=ExtResource( 11 )] +[node name="GhostBlock9" parent="GhostGroup2" instance=ExtResource( 11 )] position = Vector2( 400, 0 ) -script = ExtResource( 2 ) -[node name="GhostBlock10" type="StaticBody2D" parent="GhostGroup2" instance=ExtResource( 11 )] +[node name="GhostBlock10" parent="GhostGroup2" instance=ExtResource( 11 )] position = Vector2( 120, 200 ) -script = ExtResource( 2 ) is_active = false -[node name="GhostBlock11" type="StaticBody2D" parent="GhostGroup2" instance=ExtResource( 11 )] +[node name="GhostBlock11" parent="GhostGroup2" instance=ExtResource( 11 )] position = Vector2( 120, 240 ) -script = ExtResource( 2 ) is_active = false -[node name="GhostBlock12" type="StaticBody2D" parent="GhostGroup2" instance=ExtResource( 11 )] +[node name="GhostBlock12" parent="GhostGroup2" instance=ExtResource( 11 )] position = Vector2( 280, 200 ) -script = ExtResource( 2 ) is_active = false -[node name="GhostBlock13" type="StaticBody2D" parent="GhostGroup2" instance=ExtResource( 11 )] +[node name="GhostBlock13" parent="GhostGroup2" instance=ExtResource( 11 )] position = Vector2( 280, 240 ) -script = ExtResource( 2 ) is_active = false -[node name="GhostBlock14" type="StaticBody2D" parent="GhostGroup2" instance=ExtResource( 11 )] +[node name="GhostBlock14" parent="GhostGroup2" instance=ExtResource( 11 )] position = Vector2( 440, 200 ) -script = ExtResource( 2 ) is_active = false -[node name="GhostBlock15" type="StaticBody2D" parent="GhostGroup2" instance=ExtResource( 11 )] +[node name="GhostBlock15" parent="GhostGroup2" instance=ExtResource( 11 )] position = Vector2( 440, 240 ) -script = ExtResource( 2 ) is_active = false -[node name="GhostBlock16" type="StaticBody2D" parent="GhostGroup2" instance=ExtResource( 11 )] +[node name="GhostBlock16" parent="GhostGroup2" instance=ExtResource( 11 )] position = Vector2( 600, 200 ) -script = ExtResource( 2 ) -[node name="GhostBlock17" type="StaticBody2D" parent="GhostGroup2" instance=ExtResource( 11 )] +[node name="GhostBlock17" parent="GhostGroup2" instance=ExtResource( 11 )] position = Vector2( 600, 240 ) -script = ExtResource( 2 ) -[node name="Loop10" type="Area2D" parent="." instance=ExtResource( 4 )] +[node name="Loop10" parent="." instance=ExtResource( 4 )] position = Vector2( -720, 620 ) -collision_layer = 32 -collision_mask = 2 -script = ExtResource( 8 ) -[node name="Loop11" type="Area2D" parent="." instance=ExtResource( 4 )] +[node name="Loop11" parent="." instance=ExtResource( 4 )] position = Vector2( -700, 640 ) -collision_layer = 32 -collision_mask = 2 -script = ExtResource( 8 ) -[node name="Loop12" type="Area2D" parent="." instance=ExtResource( 4 )] +[node name="Loop12" parent="." instance=ExtResource( 4 )] position = Vector2( -680, 620 ) -collision_layer = 32 -collision_mask = 2 -script = ExtResource( 8 ) -[node name="Loop13" type="Area2D" parent="." instance=ExtResource( 4 )] +[node name="Loop13" parent="." instance=ExtResource( 4 )] position = Vector2( -680, 660 ) -collision_layer = 32 -collision_mask = 2 -script = ExtResource( 8 ) -[node name="Loop8" type="Area2D" parent="." instance=ExtResource( 4 )] +[node name="Loop8" parent="." instance=ExtResource( 4 )] position = Vector2( -720, 660 ) -collision_layer = 32 -collision_mask = 2 -script = ExtResource( 8 ) -[node name="Loop14" type="Area2D" parent="." instance=ExtResource( 4 )] +[node name="Loop14" parent="." instance=ExtResource( 4 )] position = Vector2( -340, 660 ) -collision_layer = 32 -collision_mask = 2 -script = ExtResource( 8 ) -[node name="Loop15" type="Area2D" parent="." instance=ExtResource( 4 )] +[node name="Loop15" parent="." instance=ExtResource( 4 )] position = Vector2( -500, 660 ) -collision_layer = 32 -collision_mask = 2 -script = ExtResource( 8 ) -[node name="Loop16" type="Area2D" parent="." instance=ExtResource( 4 )] +[node name="Loop16" parent="." instance=ExtResource( 4 )] position = Vector2( -180, 660 ) -collision_layer = 32 -collision_mask = 2 -script = ExtResource( 8 ) -[connection signal="body_entered" from="Loop5" to="Loop5" method="_on_Loop_body_entered"] -[connection signal="body_entered" from="Loop6" to="Loop6" method="_on_Loop_body_entered"] -[connection signal="body_entered" from="Loop7" to="Loop7" method="_on_Loop_body_entered"] -[connection signal="body_entered" from="Loop17" to="Loop17" method="_on_Loop_body_entered"] -[connection signal="body_entered" from="Loop9" to="Loop9" method="_on_Loop_body_entered"] [connection signal="clicked" from="GhostGroup2/GameButton" to="GhostGroup2" method="toggle"] -[connection signal="clicked" from="GhostGroup2/GameButton" to="GhostGroup2/GameButton" method="_on_GameButton_clicked"] -[connection signal="input_event" from="GhostGroup2/GameButton" to="GhostGroup2/GameButton" method="_on_GameButton_input_event"] [connection signal="clicked" from="GhostGroup2/GameButton2" to="GhostGroup2" method="toggle"] -[connection signal="clicked" from="GhostGroup2/GameButton2" to="GhostGroup2/GameButton2" method="_on_GameButton_clicked"] -[connection signal="input_event" from="GhostGroup2/GameButton2" to="GhostGroup2/GameButton2" method="_on_GameButton_input_event"] -[connection signal="body_entered" from="Loop10" to="Loop10" method="_on_Loop_body_entered"] -[connection signal="body_entered" from="Loop11" to="Loop11" method="_on_Loop_body_entered"] -[connection signal="body_entered" from="Loop12" to="Loop12" method="_on_Loop_body_entered"] -[connection signal="body_entered" from="Loop13" to="Loop13" method="_on_Loop_body_entered"] -[connection signal="body_entered" from="Loop8" to="Loop8" method="_on_Loop_body_entered"] -[connection signal="body_entered" from="Loop14" to="Loop14" method="_on_Loop_body_entered"] -[connection signal="body_entered" from="Loop15" to="Loop15" method="_on_Loop_body_entered"] -[connection signal="body_entered" from="Loop16" to="Loop16" method="_on_Loop_body_entered"] diff --git a/Objects/Main.tscn b/Objects/Main.tscn index c16d52c..cf90ca2 100644 --- a/Objects/Main.tscn +++ b/Objects/Main.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=12 format=2] +[gd_scene load_steps=16 format=2] [ext_resource path="res://Objects/SpecialObjects/Player.tscn" type="PackedScene" id=1] [ext_resource path="res://Objects/SpecialObjects/Conductor.tscn" type="PackedScene" id=2] @@ -6,12 +6,22 @@ [ext_resource path="res://Objects/SpecialObjects/SingleScreenWalls.tscn" type="PackedScene" id=4] [ext_resource path="res://Objects/SpecialObjects/Wrapper.tscn" type="PackedScene" id=5] [ext_resource path="res://Objects/Levels/BuzzsawChoice.tscn" type="PackedScene" id=6] +[ext_resource path="res://Objects/ScrollingObjects/WinDoor.tscn" type="PackedScene" id=7] +[ext_resource path="res://Objects/SpecialObjects/UI/LoopCountPanel.tscn" type="PackedScene" id=8] +[ext_resource path="res://Objects/SpecialObjects/UI/LoopCountPanel.gd" type="Script" id=9] [ext_resource path="res://Objects/SpecialObjects/Clock.tscn" type="PackedScene" id=10] [ext_resource path="res://Objects/Laser.tscn" type="PackedScene" id=11] [ext_resource path="res://Objects/Levels/Intro.tscn" type="PackedScene" id=12] [ext_resource path="res://Objects/Levels/Toggles.tscn" type="PackedScene" id=15] [ext_resource path="res://Objects/ScrollingObjects/Press.tscn" type="PackedScene" id=16] +[sub_resource type="StyleBoxFlat" id=1] +bg_color = Color( 0, 0, 0, 0.294118 ) +corner_radius_top_left = 10 +corner_radius_top_right = 10 +corner_radius_bottom_right = 10 +corner_radius_bottom_left = 10 + [node name="Main" type="Node2D"] __meta__ = { "_edit_horizontal_guides_": [ ] @@ -41,8 +51,21 @@ position = Vector2( 140, 660 ) [node name="Intro" parent="." instance=ExtResource( 12 )] [node name="Toggles" parent="." instance=ExtResource( 15 )] +position = Vector2( 2420, 0 ) [node name="Press" parent="." instance=ExtResource( 16 )] position = Vector2( 2900, 0 ) [node name="BuzzsawChoice" parent="." instance=ExtResource( 6 )] +position = Vector2( 3480, 0 ) + +[node name="WinDoor" parent="." instance=ExtResource( 7 )] +position = Vector2( 740, 680 ) + +[node name="LoopCountPanel" parent="." instance=ExtResource( 8 )] +margin_left = 120.0 +margin_right = 220.0 +custom_styles/panel = SubResource( 1 ) +script = ExtResource( 9 ) +[connection signal="loop_collected" from="Player" to="LoopCountPanel" method="_on_Player_loop_collected"] +[connection signal="body_entered" from="WinDoor" to="Player" method="_on_WinDoor_body_entered"] diff --git a/Objects/ScrollingObjects/Buzzsaw.gd b/Objects/ScrollingObjects/Buzzsaw.gd index 52a3741..ed2ce48 100644 --- a/Objects/ScrollingObjects/Buzzsaw.gd +++ b/Objects/ScrollingObjects/Buzzsaw.gd @@ -4,3 +4,7 @@ class_name Buzzsaw func _ready(): $AnimationPlayer.play("SpinClockwise") + + +func _on_Buzzsaw_body_entered(body): + body.die() diff --git a/Objects/ScrollingObjects/Buzzsaw.tscn b/Objects/ScrollingObjects/Buzzsaw.tscn index 3215a36..ccb90e8 100644 --- a/Objects/ScrollingObjects/Buzzsaw.tscn +++ b/Objects/ScrollingObjects/Buzzsaw.tscn @@ -25,6 +25,8 @@ tracks/0/keys = { } [node name="Buzzsaw" type="Area2D"] +collision_layer = 8 +collision_mask = 2 script = ExtResource( 2 ) [node name="CollisionShape2D" type="CollisionShape2D" parent="."] @@ -43,3 +45,4 @@ anims/SpinClockwise = SubResource( 2 ) [node name="WrapParent" parent="." instance=ExtResource( 4 )] position = Vector2( 80, 0 ) +[connection signal="body_entered" from="." to="." method="_on_Buzzsaw_body_entered"] diff --git a/Objects/ScrollingObjects/Loop.gd b/Objects/ScrollingObjects/Loop.gd index 12cb589..416f3ae 100644 --- a/Objects/ScrollingObjects/Loop.gd +++ b/Objects/ScrollingObjects/Loop.gd @@ -16,6 +16,7 @@ func _on_Loop_body_entered(body): emit_signal("picked_up") body.loops_collected += 1 body.get_node("Donut").self_modulate = $Sprite.self_modulate + body.emit_signal("loop_collected", body.loops_collected) $AnimationPlayer.play("pop fade out") diff --git a/Objects/ScrollingObjects/Press.gd b/Objects/ScrollingObjects/Press.gd index f9afa78..ac295e0 100644 --- a/Objects/ScrollingObjects/Press.gd +++ b/Objects/ScrollingObjects/Press.gd @@ -22,3 +22,7 @@ func _subbeat(subbeat_num): $AnimationPlayer.play("Stomp") elif (subbeat_num - subbeat_offset) % 48 == 24: $AnimationPlayer.play_backwards("Stomp") + + +func _on_StompArea_body_entered(body): + body.die() diff --git a/Objects/ScrollingObjects/Press.tscn b/Objects/ScrollingObjects/Press.tscn index 70ea072..bc01b83 100644 --- a/Objects/ScrollingObjects/Press.tscn +++ b/Objects/ScrollingObjects/Press.tscn @@ -62,6 +62,7 @@ tracks/4/keys = { } [node name="Press" type="KinematicBody2D"] +z_index = 3 script = ExtResource( 2 ) [node name="AnimationPlayer" type="AnimationPlayer" parent="."] @@ -98,3 +99,4 @@ position = Vector2( 0, 76.5 ) [node name="WrapParent" parent="." instance=ExtResource( 4 )] position = Vector2( 80, 0 ) +[connection signal="body_entered" from="Bottom/StompArea" to="." method="_on_StompArea_body_entered"] diff --git a/Objects/ScrollingObjects/ScrollingLaser.tscn b/Objects/ScrollingObjects/ScrollingLaser.tscn index 50674a6..c79fc12 100644 --- a/Objects/ScrollingObjects/ScrollingLaser.tscn +++ b/Objects/ScrollingObjects/ScrollingLaser.tscn @@ -12,6 +12,8 @@ script = ExtResource( 2 ) [node name="Beam" type="Area2D" parent="."] +collision_layer = 2147483656 +collision_mask = 2 [node name="Raycast" type="RayCast2D" parent="Beam"] visible = false @@ -46,3 +48,4 @@ texture = ExtResource( 1 ) [node name="ConveyorScrollParent" parent="." instance=ExtResource( 7 )] [node name="WrapParent" parent="." instance=ExtResource( 6 )] +[connection signal="body_entered" from="Beam" to="." method="_on_Beam_body_entered"] diff --git a/Objects/ScrollingObjects/WinDoor.tscn b/Objects/ScrollingObjects/WinDoor.tscn new file mode 100644 index 0000000..a09cf2c --- /dev/null +++ b/Objects/ScrollingObjects/WinDoor.tscn @@ -0,0 +1,26 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://Objects/ScrollingObjects/Utilities/WrapParent.tscn" type="PackedScene" id=1] +[ext_resource path="res://Objects/ScrollingObjects/Utilities/ConveyorScrollParent.tscn" type="PackedScene" id=2] +[ext_resource path="res://Sprites/exit.png" type="Texture" id=3] + +[sub_resource type="CapsuleShape2D" id=1] +radius = 29.9249 +height = 104.953 + +[node name="WinDoor" type="Area2D"] +z_index = -1 +input_pickable = false +collision_layer = 2147483712 +collision_mask = 2 + +[node name="ConveyorScrollParent" parent="." instance=ExtResource( 2 )] + +[node name="WrapParent" parent="." instance=ExtResource( 1 )] + +[node name="Sprite" type="Sprite" parent="."] +position = Vector2( 0, -45 ) +texture = ExtResource( 3 ) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource( 1 ) diff --git a/Objects/SpecialObjects/Clock.tscn b/Objects/SpecialObjects/Clock.tscn index 1f8e817..f5fbf01 100644 --- a/Objects/SpecialObjects/Clock.tscn +++ b/Objects/SpecialObjects/Clock.tscn @@ -21,6 +21,7 @@ tracks/0/keys = { } [node name="Clock" type="Node2D"] +z_index = 5 script = ExtResource( 2 ) [node name="Sprite" type="Sprite" parent="."] diff --git a/Objects/SpecialObjects/GameStats.tscn b/Objects/SpecialObjects/GameStats.tscn deleted file mode 100644 index 54d69bf..0000000 --- a/Objects/SpecialObjects/GameStats.tscn +++ /dev/null @@ -1,21 +0,0 @@ -[gd_scene load_steps=2 format=2] - -[sub_resource type="GDScript" id=1] -script/source = "extends Node - - -var loops_collected - - -# Called when the node enters the scene tree for the first time. -func _ready(): - pass # Replace with function body. - - -# Called every frame. 'delta' is the elapsed time since the previous frame. -#func _process(delta): -# pass -" - -[node name="GameStats" type="Node"] -script = SubResource( 1 ) diff --git a/Objects/SpecialObjects/Player.gd b/Objects/SpecialObjects/Player.gd index 7ca4d0d..0f9dc74 100644 --- a/Objects/SpecialObjects/Player.gd +++ b/Objects/SpecialObjects/Player.gd @@ -1,7 +1,6 @@ extends KinematicBody2D class_name Player - var rng = RandomNumberGenerator.new() @@ -17,6 +16,8 @@ var can_jump: bool = false var jump_buffer: int = 0 var is_quick_falling: bool = false var quick_fall_buffer: int = 0 + +signal loop_collected(loops) var loops_collected: int = 0 func get_floor(): @@ -29,6 +30,7 @@ func get_floor(): func _ready(): $Donut.self_modulate = Color.from_hsv(rng.randf_range(0.0, 1.0), 0.4, 1) + emit_signal("loop_collected", loops_collected) func up_normal(): return -gravity.normalized() @@ -122,3 +124,20 @@ func _physics_process(_delta): movement += Vector2.RIGHT * move_speed move_and_slide(movement, up_normal) + + +func win(): + print("YOU WIN!") + print("You collected %s loops." % loops_collected) + +func die(): + print("YOU DIED") + print("You collected %s loops." % loops_collected) + + +func _on_WinDoor_body_entered(body): + win() + + +func _on_Area2D_body_entered(body): + die() diff --git a/Objects/SpecialObjects/Player.tscn b/Objects/SpecialObjects/Player.tscn index 05d347b..6bbabd4 100644 --- a/Objects/SpecialObjects/Player.tscn +++ b/Objects/SpecialObjects/Player.tscn @@ -1,14 +1,18 @@ -[gd_scene load_steps=6 format=2] +[gd_scene load_steps=7 format=2] [ext_resource path="res://Sprites/Gatto/Donut.tres" type="SpriteFrames" id=1] [ext_resource path="res://Objects/SpecialObjects/Player.gd" type="Script" id=2] [ext_resource path="res://Sprites/Gatto/Body.tres" type="SpriteFrames" id=3] [ext_resource path="res://Sprites/Gatto/Legs.tres" type="SpriteFrames" id=4] +[sub_resource type="RectangleShape2D" id=2] +extents = Vector2( 19, 19 ) + [sub_resource type="RectangleShape2D" id=1] -extents = Vector2( 18, 18 ) +extents = Vector2( 17, 17 ) [node name="Player" type="KinematicBody2D"] +z_index = 1 collision_layer = 2 collision_mask = 2147483677 script = ExtResource( 2 ) @@ -16,7 +20,7 @@ jump_speed = 493.0 [node name="Body" type="AnimatedSprite" parent="."] frames = ExtResource( 3 ) -animation = "up" +animation = "neutral" playing = true [node name="Donut" type="AnimatedSprite" parent="."] @@ -32,4 +36,13 @@ animation = "neutral" playing = true [node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource( 2 ) + +[node name="Area2D" type="Area2D" parent="."] +input_pickable = false +collision_layer = 2 +collision_mask = 29 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] shape = SubResource( 1 ) +[connection signal="body_entered" from="Area2D" to="." method="_on_Area2D_body_entered"] diff --git a/Objects/SpecialObjects/UI/LoopCountPanel.gd b/Objects/SpecialObjects/UI/LoopCountPanel.gd new file mode 100644 index 0000000..f3b7c3f --- /dev/null +++ b/Objects/SpecialObjects/UI/LoopCountPanel.gd @@ -0,0 +1,7 @@ +extends Panel +class_name LoopCountPanel + + + +func _on_Player_loop_collected(loops): + $LoopCountLabel.text = "%d" % loops diff --git a/Objects/SpecialObjects/UI/LoopCountPanel.tscn b/Objects/SpecialObjects/UI/LoopCountPanel.tscn new file mode 100644 index 0000000..2d44064 --- /dev/null +++ b/Objects/SpecialObjects/UI/LoopCountPanel.tscn @@ -0,0 +1,40 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://Sprites/lööp.png" type="Texture" id=1] +[ext_resource path="res://Fonts/LiberationMono-Bold.ttf" type="DynamicFontData" id=2] + +[sub_resource type="DynamicFont" id=1] +size = 30 +font_data = ExtResource( 2 ) + +[node name="LoopCountPanel" type="Panel"] +margin_left = 1160.0 +margin_top = 20.0 +margin_right = 1260.0 +margin_bottom = 60.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="LoopCountLabel" type="Label" parent="."] +margin_left = 40.0 +margin_right = 94.0 +margin_bottom = 40.0 +custom_fonts/font = SubResource( 1 ) +text = "999" +align = 2 +valign = 1 +clip_text = true +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="TextureRect" type="TextureRect" parent="."] +margin_right = 40.0 +margin_bottom = 40.0 +texture = ExtResource( 1 ) +expand = true +stretch_mode = 6 +__meta__ = { +"_edit_use_anchors_": false +} diff --git a/Sprites/Gatto/gatto_alto.png.import b/Sprites/Gatto/gatto_alto.png.import index 18e3281..17d7339 100644 --- a/Sprites/Gatto/gatto_alto.png.import +++ b/Sprites/Gatto/gatto_alto.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Sprites/Gatto/gatto_alto_dx.png.import b/Sprites/Gatto/gatto_alto_dx.png.import index 21e29b9..79f3a8f 100644 --- a/Sprites/Gatto/gatto_alto_dx.png.import +++ b/Sprites/Gatto/gatto_alto_dx.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Sprites/Gatto/gatto_alto_lato.png.import b/Sprites/Gatto/gatto_alto_lato.png.import index dcc54fa..50e9b70 100644 --- a/Sprites/Gatto/gatto_alto_lato.png.import +++ b/Sprites/Gatto/gatto_alto_lato.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Sprites/Gatto/gatto_basso.png.import b/Sprites/Gatto/gatto_basso.png.import index eb88814..7ae36cd 100644 --- a/Sprites/Gatto/gatto_basso.png.import +++ b/Sprites/Gatto/gatto_basso.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Sprites/Gatto/gatto_basso_dx.png.import b/Sprites/Gatto/gatto_basso_dx.png.import index 5645a0b..d71025e 100644 --- a/Sprites/Gatto/gatto_basso_dx.png.import +++ b/Sprites/Gatto/gatto_basso_dx.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Sprites/Gatto/gatto_basso_lato.png.import b/Sprites/Gatto/gatto_basso_lato.png.import index 8b040d1..ca64bb5 100644 --- a/Sprites/Gatto/gatto_basso_lato.png.import +++ b/Sprites/Gatto/gatto_basso_lato.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Sprites/Gatto/gatto_centro.png.import b/Sprites/Gatto/gatto_centro.png.import index 50d57d3..414b73f 100644 --- a/Sprites/Gatto/gatto_centro.png.import +++ b/Sprites/Gatto/gatto_centro.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Sprites/Gatto/gatto_dx.png.import b/Sprites/Gatto/gatto_dx.png.import index b378d72..30b1cf4 100644 --- a/Sprites/Gatto/gatto_dx.png.import +++ b/Sprites/Gatto/gatto_dx.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Sprites/Gatto/gatto_lato.png.import b/Sprites/Gatto/gatto_lato.png.import index 2fc6122..829021a 100644 --- a/Sprites/Gatto/gatto_lato.png.import +++ b/Sprites/Gatto/gatto_lato.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Sprites/Gatto/loop_alto.png.import b/Sprites/Gatto/loop_alto.png.import index 7646898..d2aabd2 100644 --- a/Sprites/Gatto/loop_alto.png.import +++ b/Sprites/Gatto/loop_alto.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Sprites/Gatto/loop_basso.png.import b/Sprites/Gatto/loop_basso.png.import index 8a47492..833b6e5 100644 --- a/Sprites/Gatto/loop_basso.png.import +++ b/Sprites/Gatto/loop_basso.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Sprites/Gatto/loop_centro.png.import b/Sprites/Gatto/loop_centro.png.import index c714d3a..7121d7d 100644 --- a/Sprites/Gatto/loop_centro.png.import +++ b/Sprites/Gatto/loop_centro.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Sprites/Gatto/zampe_alto.png.import b/Sprites/Gatto/zampe_alto.png.import index 645234a..886fefc 100644 --- a/Sprites/Gatto/zampe_alto.png.import +++ b/Sprites/Gatto/zampe_alto.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Sprites/Gatto/zampe_alto_dx.png.import b/Sprites/Gatto/zampe_alto_dx.png.import index 3d1bdb6..7d76e76 100644 --- a/Sprites/Gatto/zampe_alto_dx.png.import +++ b/Sprites/Gatto/zampe_alto_dx.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Sprites/Gatto/zampe_alto_lato.png.import b/Sprites/Gatto/zampe_alto_lato.png.import index 999a545..bff699f 100644 --- a/Sprites/Gatto/zampe_alto_lato.png.import +++ b/Sprites/Gatto/zampe_alto_lato.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Sprites/Gatto/zampe_basso.png.import b/Sprites/Gatto/zampe_basso.png.import index 23127a5..c578f70 100644 --- a/Sprites/Gatto/zampe_basso.png.import +++ b/Sprites/Gatto/zampe_basso.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Sprites/Gatto/zampe_basso_dx.png.import b/Sprites/Gatto/zampe_basso_dx.png.import index c2587af..c6ca5ca 100644 --- a/Sprites/Gatto/zampe_basso_dx.png.import +++ b/Sprites/Gatto/zampe_basso_dx.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Sprites/Gatto/zampe_basso_lato.png.import b/Sprites/Gatto/zampe_basso_lato.png.import index b5806bc..0595426 100644 --- a/Sprites/Gatto/zampe_basso_lato.png.import +++ b/Sprites/Gatto/zampe_basso_lato.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Sprites/Gatto/zampe_centro.png.import b/Sprites/Gatto/zampe_centro.png.import index a08a489..becbf20 100644 --- a/Sprites/Gatto/zampe_centro.png.import +++ b/Sprites/Gatto/zampe_centro.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Sprites/Gatto/zampe_dx_1.png.import b/Sprites/Gatto/zampe_dx_1.png.import index 4eef907..c289c28 100644 --- a/Sprites/Gatto/zampe_dx_1.png.import +++ b/Sprites/Gatto/zampe_dx_1.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Sprites/Gatto/zampe_dx_2.png.import b/Sprites/Gatto/zampe_dx_2.png.import index 74c662b..3fe297c 100644 --- a/Sprites/Gatto/zampe_dx_2.png.import +++ b/Sprites/Gatto/zampe_dx_2.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Sprites/Gatto/zampe_dx_3.png.import b/Sprites/Gatto/zampe_dx_3.png.import index 530d331..a267c4c 100644 --- a/Sprites/Gatto/zampe_dx_3.png.import +++ b/Sprites/Gatto/zampe_dx_3.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Sprites/Gatto/zampe_lato_1.png.import b/Sprites/Gatto/zampe_lato_1.png.import index 377bd32..093cf93 100644 --- a/Sprites/Gatto/zampe_lato_1.png.import +++ b/Sprites/Gatto/zampe_lato_1.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Sprites/Gatto/zampe_lato_2.png.import b/Sprites/Gatto/zampe_lato_2.png.import index 53506d8..0f127df 100644 --- a/Sprites/Gatto/zampe_lato_2.png.import +++ b/Sprites/Gatto/zampe_lato_2.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Sprites/Gatto/zampe_lato_3.png.import b/Sprites/Gatto/zampe_lato_3.png.import index e2dcc34..af2db67 100644 --- a/Sprites/Gatto/zampe_lato_3.png.import +++ b/Sprites/Gatto/zampe_lato_3.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Sprites/exit.png.import b/Sprites/exit.png.import index b81d4a6..3309549 100644 --- a/Sprites/exit.png.import +++ b/Sprites/exit.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/project.godot b/project.godot index 4a8a39b..6a1c5a1 100644 --- a/project.godot +++ b/project.godot @@ -54,6 +54,11 @@ _global_script_classes=[ { "language": "GDScript", "path": "res://Objects/ScrollingObjects/Loop.gd" }, { +"base": "Panel", +"class": "LoopCountPanel", +"language": "GDScript", +"path": "res://Objects/SpecialObjects/UI/LoopCountPanel.gd" +}, { "base": "Control", "class": "Menu", "language": "GDScript", @@ -99,6 +104,7 @@ _global_script_class_icons={ "GameButton": "", "GhostBlock": "", "Loop": "", +"LoopCountPanel": "", "Menu": "", "Player": "", "Press": "", @@ -110,7 +116,7 @@ _global_script_class_icons={ [application] -config/name="ld47" +config/name="Looping for Lööps" run/main_scene="res://Objects/Menu.tscn" config/icon="res://Sprites/clock.png" @@ -151,6 +157,7 @@ plr_right={ 2d_physics/layer_4="Obstacles" 2d_physics/layer_5="Screen Walls" 2d_physics/layer_6="Lööps" +2d_physics/layer_7="Win Door" [rendering]