added pipes and interact blocks
This commit is contained in:
+60
-1
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=11 format=3 uid="uid://dk1aby88pygtr"]
|
||||
[gd_scene load_steps=13 format=3 uid="uid://dk1aby88pygtr"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/player.gd" id="1_lm7ix"]
|
||||
[ext_resource type="Texture2D" uid="uid://dhw3lpuskbvku" path="res://assets/mario-luigi-4.png" id="1_w3chr"]
|
||||
@@ -72,10 +72,33 @@ animations = [{
|
||||
radius = 6.0
|
||||
height = 16.0
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_sqgi2"]
|
||||
size = Vector2(8, 1)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_okc7h"]
|
||||
size = Vector2(1, 2)
|
||||
|
||||
[node name="player" type="CharacterBody2D"]
|
||||
position = Vector2(0, -10)
|
||||
collision_layer = 2
|
||||
script = ExtResource("1_lm7ix")
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="."]
|
||||
position = Vector2(35, 0)
|
||||
zoom = Vector2(3, 3)
|
||||
limit_left = -160
|
||||
limit_bottom = 32
|
||||
position_smoothing_enabled = true
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="Camera2D"]
|
||||
visible = false
|
||||
z_index = 10
|
||||
offset_left = -3995.0
|
||||
offset_top = -1678.0
|
||||
offset_right = 3965.0
|
||||
offset_bottom = 1594.0
|
||||
color = Color(0, 0, 0, 1)
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(0, 2)
|
||||
sprite_frames = SubResource("SpriteFrames_l5s58")
|
||||
@@ -84,3 +107,39 @@ animation = &"jump"
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0, 2)
|
||||
shape = SubResource("CapsuleShape2D_4sl4a")
|
||||
|
||||
[node name="pipedetector_ground" type="Area2D" parent="."]
|
||||
collision_mask = 4
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="pipedetector_ground"]
|
||||
position = Vector2(0, 10.5)
|
||||
shape = SubResource("RectangleShape2D_sqgi2")
|
||||
|
||||
[node name="pipedetector_right" type="Area2D" parent="."]
|
||||
collision_mask = 4
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="pipedetector_right"]
|
||||
position = Vector2(6.5, -2)
|
||||
shape = SubResource("RectangleShape2D_okc7h")
|
||||
|
||||
[node name="pipedetector_left" type="Area2D" parent="."]
|
||||
position = Vector2(-13, -4)
|
||||
collision_mask = 4
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="pipedetector_left"]
|
||||
position = Vector2(6.5, 2)
|
||||
shape = SubResource("RectangleShape2D_okc7h")
|
||||
|
||||
[node name="pipe_timer" type="Timer" parent="."]
|
||||
wait_time = 2.0
|
||||
one_shot = true
|
||||
|
||||
[node name="pipe_timer_half" type="Timer" parent="."]
|
||||
one_shot = true
|
||||
|
||||
[connection signal="area_entered" from="pipedetector_ground" to="." method="_on_pipedetector_area_entered"]
|
||||
[connection signal="area_exited" from="pipedetector_ground" to="." method="_on_pipedetector_area_exited"]
|
||||
[connection signal="area_entered" from="pipedetector_right" to="." method="_on_pipedetector_right_area_entered"]
|
||||
[connection signal="area_exited" from="pipedetector_right" to="." method="_on_pipedetector_right_area_exited"]
|
||||
[connection signal="timeout" from="pipe_timer" to="." method="_on_pipe_timer_timeout"]
|
||||
[connection signal="timeout" from="pipe_timer_half" to="." method="_on_pipe_timer_half_timeout"]
|
||||
|
||||
Reference in New Issue
Block a user