mirror of
https://github.com/Steffo99/looping-for-loops.git
synced 2024-11-21 15:44:24 +00:00
💥 i gave up atomic commits a long time ago
This commit is contained in:
parent
ea8753a536
commit
0fedd6a1d2
45 changed files with 231 additions and 188 deletions
|
@ -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()
|
||||
|
|
|
@ -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"]
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"]
|
||||
|
|
|
@ -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"]
|
||||
|
|
|
@ -4,3 +4,7 @@ class_name Buzzsaw
|
|||
|
||||
func _ready():
|
||||
$AnimationPlayer.play("SpinClockwise")
|
||||
|
||||
|
||||
func _on_Buzzsaw_body_entered(body):
|
||||
body.die()
|
||||
|
|
|
@ -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"]
|
||||
|
|
|
@ -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")
|
||||
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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"]
|
||||
|
|
|
@ -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"]
|
||||
|
|
26
Objects/ScrollingObjects/WinDoor.tscn
Normal file
26
Objects/ScrollingObjects/WinDoor.tscn
Normal file
|
@ -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 )
|
|
@ -21,6 +21,7 @@ tracks/0/keys = {
|
|||
}
|
||||
|
||||
[node name="Clock" type="Node2D"]
|
||||
z_index = 5
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
|
|
|
@ -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 )
|
|
@ -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()
|
||||
|
|
|
@ -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"]
|
||||
|
|
7
Objects/SpecialObjects/UI/LoopCountPanel.gd
Normal file
7
Objects/SpecialObjects/UI/LoopCountPanel.gd
Normal file
|
@ -0,0 +1,7 @@
|
|||
extends Panel
|
||||
class_name LoopCountPanel
|
||||
|
||||
|
||||
|
||||
func _on_Player_loop_collected(loops):
|
||||
$LoopCountLabel.text = "%d" % loops
|
40
Objects/SpecialObjects/UI/LoopCountPanel.tscn
Normal file
40
Objects/SpecialObjects/UI/LoopCountPanel.tscn
Normal file
|
@ -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
|
||||
}
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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]
|
||||
|
||||
|
|
Loading…
Reference in a new issue