made falling blocks harder
This commit is contained in:
parent
afe7c35ea7
commit
aa39838e16
2 changed files with 9 additions and 8 deletions
|
@ -31,6 +31,8 @@ func _on_Area2D_area_entered(area):
|
|||
func _on_VisibilityNotifier2D_screen_exited():
|
||||
position = startpos
|
||||
fall = false
|
||||
refresh_timer.stop()
|
||||
anims.play("disappear", -1, -1.0, true)
|
||||
|
||||
func _on_RefreshTimer_timeout():
|
||||
collision_shape.disabled = true # disable collision
|
||||
|
@ -39,11 +41,12 @@ func _on_RefreshTimer_timeout():
|
|||
collision_shape.call_deferred("set_disabled", false)
|
||||
fall = false
|
||||
anims.play("idle")
|
||||
anims.play("disappear", -1, -1.0, true)
|
||||
|
||||
func _on_FallTimer_timeout():
|
||||
fall = true
|
||||
refresh_timer.start()
|
||||
|
||||
|
||||
func _on_Area2D_area_exited(area):
|
||||
fall_timer.stop()
|
||||
#func _on_Area2D_area_exited(area):
|
||||
# fall_timer.stop()
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
extents = Vector2( 4, 1.5 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=2]
|
||||
extents = Vector2( 4, 0.5 )
|
||||
extents = Vector2( 3.5, 0.5 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=3]
|
||||
extents = Vector2( 3, 0.5 )
|
||||
|
@ -47,13 +47,13 @@ tracks/0/keys = {
|
|||
[node name="FallingBlock" type="KinematicBody2D"]
|
||||
collision_layer = 4
|
||||
script = ExtResource( 2 )
|
||||
fall_speed = 1.0
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
texture = ExtResource( 1 )
|
||||
centered = false
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
visible = false
|
||||
position = Vector2( 4, 2.5 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
|
@ -63,16 +63,15 @@ position = Vector2( 4, 4 )
|
|||
scale = Vector2( 0.4, 0.4 )
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
visible = false
|
||||
collision_mask = 2
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
position = Vector2( 4, -0.5 )
|
||||
position = Vector2( 4, 0 )
|
||||
shape = SubResource( 2 )
|
||||
|
||||
[node name="FallTimer" type="Timer" parent="."]
|
||||
process_mode = 0
|
||||
wait_time = 0.15
|
||||
wait_time = 0.1
|
||||
one_shot = true
|
||||
|
||||
[node name="RefreshTimer" type="Timer" parent="."]
|
||||
|
@ -94,6 +93,5 @@ anims/idle = SubResource( 5 )
|
|||
|
||||
[connection signal="screen_exited" from="VisibilityNotifier2D" to="." method="_on_VisibilityNotifier2D_screen_exited"]
|
||||
[connection signal="area_entered" from="Area2D" to="." method="_on_Area2D_area_entered"]
|
||||
[connection signal="area_exited" from="Area2D" to="." method="_on_Area2D_area_exited"]
|
||||
[connection signal="timeout" from="FallTimer" to="." method="_on_FallTimer_timeout"]
|
||||
[connection signal="timeout" from="RefreshTimer" to="." method="_on_RefreshTimer_timeout"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue