level 2 - moving plattforms

level2 almost finished
This commit is contained in:
Jonas Braus
2024-08-02 22:44:01 +02:00
parent a4476f2ce2
commit a706375da0
18 changed files with 46260 additions and 150 deletions
+185
View File
@@ -0,0 +1,185 @@
[gd_scene load_steps=12 format=3 uid="uid://cc4excywfdh1v"]
[ext_resource type="Script" path="res://scripts/blocks/destroyblock.gd" id="1_b75an"]
[ext_resource type="Texture2D" uid="uid://bbf2n32u766cp" path="res://assets/bg-1-2.png" id="2_4uaoj"]
[ext_resource type="AudioStream" uid="uid://dkb0efnhs6mrj" path="res://assets/sounds/NES - Super Mario Bros - Sound Effects/Super Mario Bros 1 and 2(JP)/Break.wav" id="3_0trkf"]
[sub_resource type="AtlasTexture" id="AtlasTexture_xwgx1"]
atlas = ExtResource("2_4uaoj")
region = Rect2(96, 272, 16, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_r70hc"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_xwgx1")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_i07jg"]
size = Vector2(16, 16)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_r8vfl"]
size = Vector2(10, 1)
[sub_resource type="Animation" id="Animation_la8ht"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("CollisionShape2D:disabled")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("destroySound:playing")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("AnimatedSprite2D:visible")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="Animation" id="Animation_hu2np"]
resource_name = "destroy"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("CollisionShape2D:disabled")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("destroySound:playing")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/2/type = "method"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath(".")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(1),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"queue_free"
}]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("AnimatedSprite2D:visible")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="Animation" id="Animation_4lptd"]
resource_name = "idle"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("CollisionShape2D:disabled")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("AnimatedSprite2D:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_55ebx"]
_data = {
"RESET": SubResource("Animation_la8ht"),
"destroy": SubResource("Animation_hu2np"),
"idle": SubResource("Animation_4lptd")
}
[node name="destroyblock_dark" type="RigidBody2D"]
gravity_scale = 0.0
script = ExtResource("1_b75an")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
visible = false
position = Vector2(8, -8)
sprite_frames = SubResource("SpriteFrames_r70hc")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(8, -8)
shape = SubResource("RectangleShape2D_i07jg")
disabled = true
[node name="activate" type="Area2D" parent="."]
collision_mask = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="activate"]
position = Vector2(8, 0.5)
shape = SubResource("RectangleShape2D_r8vfl")
[node name="destroySound" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("3_0trkf")
volume_db = 5.0
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
"": SubResource("AnimationLibrary_55ebx")
}
autoplay = "idle"
[connection signal="body_entered" from="activate" to="." method="_on_activate_body_entered"]
+37
View File
@@ -0,0 +1,37 @@
[gd_scene load_steps=6 format=3 uid="uid://dad1wol24icj0"]
[ext_resource type="Script" path="res://scripts/blocks/move_platform.gd" id="1_olty2"]
[ext_resource type="Texture2D" uid="uid://dth47lmb44qk8" path="res://assets/items.png" id="2_tugy1"]
[sub_resource type="AtlasTexture" id="AtlasTexture_ybhkw"]
atlas = ExtResource("2_tugy1")
region = Rect2(63, 38, 48, 8)
[sub_resource type="SpriteFrames" id="SpriteFrames_hdxpr"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_ybhkw")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_w18em"]
size = Vector2(48, 8)
[node name="MovePlatform" type="RigidBody2D"]
collision_mask = 0
gravity_scale = 0.0
sleeping = true
lock_rotation = true
script = ExtResource("1_olty2")
veloc = Vector2(0, 50)
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_hdxpr")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_w18em")
one_way_collision = true
+37
View File
@@ -0,0 +1,37 @@
[gd_scene load_steps=6 format=3 uid="uid://bofueafaqy7so"]
[ext_resource type="Script" path="res://scripts/blocks/move_platform.gd" id="1_lakrn"]
[ext_resource type="Texture2D" uid="uid://dth47lmb44qk8" path="res://assets/items.png" id="2_2bvoe"]
[sub_resource type="AtlasTexture" id="AtlasTexture_ybhkw"]
atlas = ExtResource("2_2bvoe")
region = Rect2(63, 38, 48, 8)
[sub_resource type="SpriteFrames" id="SpriteFrames_hdxpr"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_ybhkw")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_w18em"]
size = Vector2(48, 8)
[node name="MovePlatform" type="RigidBody2D"]
collision_mask = 0
gravity_scale = 0.0
lock_rotation = true
script = ExtResource("1_lakrn")
veloc = Vector2(0, -50)
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_hdxpr")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
rotation = -6.28318
shape = SubResource("RectangleShape2D_w18em")
one_way_collision = true
+10
View File
@@ -0,0 +1,10 @@
[gd_scene load_steps=2 format=3 uid="uid://ct54hcx2h7riy"]
[ext_resource type="Script" path="res://scripts/blocks/spawner.gd" id="1_du4pp"]
[node name="Spawner" type="Node2D"]
script = ExtResource("1_du4pp")
[node name="Timer" type="Timer" parent="."]
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]
+48
View File
@@ -0,0 +1,48 @@
[gd_scene load_steps=6 format=3 uid="uid://bm04qp5vgbi10"]
[ext_resource type="Script" path="res://scripts/Flag.gd" id="1_3p67j"]
[ext_resource type="PackedScene" uid="uid://c0r61y2b3pt4m" path="res://scenes/levels/level_2.tscn" id="2_u50ce"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ihwdr"]
size = Vector2(6, 201)
[sub_resource type="Animation" id="Animation_ivwqs"]
resource_name = "change_scene"
length = 4.0
tracks/0/type = "method"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(4),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"load_new_scene"
}]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_adywb"]
_data = {
"change_scene": SubResource("Animation_ivwqs")
}
[node name="Flag" type="Area2D"]
position = Vector2(3176, -19)
collision_layer = 32769
collision_mask = 2
script = ExtResource("1_3p67j")
load_level = ExtResource("2_u50ce")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, -98.5)
shape = SubResource("RectangleShape2D_ihwdr")
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
"": SubResource("AnimationLibrary_adywb")
}
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -3,12 +3,12 @@
[ext_resource type="Script" path="res://scripts/pipe.gd" id="1_akqs5"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_5w6v5"]
size = Vector2(30, 1)
size = Vector2(30, 2)
[node name="pipe" type="Area2D"]
collision_layer = 4
script = ExtResource("1_akqs5")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(16, -0.5)
position = Vector2(16, 0)
shape = SubResource("RectangleShape2D_5w6v5")
+1 -1
View File
@@ -177,7 +177,7 @@ animations = [{
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_4sl4a"]
radius = 6.0
height = 16.0
height = 15.0
[sub_resource type="RectangleShape2D" id="RectangleShape2D_sqgi2"]
size = Vector2(8, 1)