level 2 - moving plattforms
level2 almost finished
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
@@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://bbf2n32u766cp"
|
||||||
|
path="res://.godot/imported/bg-1-2.png-81ae6ae7479c4c330a362a6052bf4c22.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/bg-1-2.png"
|
||||||
|
dest_files=["res://.godot/imported/bg-1-2.png-81ae6ae7479c4c330a362a6052bf4c22.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
+14
-13
@@ -12,7 +12,7 @@ config_version=5
|
|||||||
|
|
||||||
config/name="RetroMario"
|
config/name="RetroMario"
|
||||||
config/version="0.1"
|
config/version="0.1"
|
||||||
run/main_scene="res://scenes/level_1.tscn"
|
run/main_scene="res://scenes/levels/level_1.tscn"
|
||||||
config/features=PackedStringArray("4.2", "Forward Plus")
|
config/features=PackedStringArray("4.2", "Forward Plus")
|
||||||
boot_splash/show_image=false
|
boot_splash/show_image=false
|
||||||
config/icon="res://assets/icon.png"
|
config/icon="res://assets/icon.png"
|
||||||
@@ -22,6 +22,10 @@ config/icon="res://assets/icon.png"
|
|||||||
window/stretch/mode="viewport"
|
window/stretch/mode="viewport"
|
||||||
window/stretch/aspect="keep_height"
|
window/stretch/aspect="keep_height"
|
||||||
|
|
||||||
|
[global]
|
||||||
|
|
||||||
|
itch=false
|
||||||
|
|
||||||
[input]
|
[input]
|
||||||
|
|
||||||
ui_text_newline={
|
ui_text_newline={
|
||||||
@@ -35,34 +39,31 @@ ui_text_caret_document_end={
|
|||||||
}
|
}
|
||||||
move_left={
|
move_left={
|
||||||
"deadzone": 0.5,
|
"deadzone": 0.5,
|
||||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"echo":false,"script":null)
|
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":-1.0,"script":null)
|
||||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194319,"key_label":0,"unicode":0,"echo":false,"script":null)
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"echo":false,"script":null)
|
||||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":-1.0,"script":null)
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
move_right={
|
move_right={
|
||||||
"deadzone": 0.5,
|
"deadzone": 0.5,
|
||||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"echo":false,"script":null)
|
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":1.0,"script":null)
|
||||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194321,"key_label":0,"unicode":0,"echo":false,"script":null)
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"echo":false,"script":null)
|
||||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":1.0,"script":null)
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
jump={
|
jump={
|
||||||
"deadzone": 0.5,
|
"deadzone": 0.5,
|
||||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"echo":false,"script":null)
|
"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":true,"script":null)
|
||||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":true,"script":null)
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"echo":false,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
crawl={
|
crawl={
|
||||||
"deadzone": 0.5,
|
"deadzone": 0.5,
|
||||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"echo":false,"script":null)
|
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":1.0,"script":null)
|
||||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":1.0,"script":null)
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"echo":false,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
flower={
|
flower={
|
||||||
"deadzone": 0.5,
|
"deadzone": 0.5,
|
||||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"echo":false,"script":null)
|
"events": []
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[input_devices]
|
[input_devices]
|
||||||
|
|||||||
@@ -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"]
|
||||||
@@ -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
|
||||||
@@ -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
|
||||||
@@ -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"]
|
||||||
@@ -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
@@ -3,12 +3,12 @@
|
|||||||
[ext_resource type="Script" path="res://scripts/pipe.gd" id="1_akqs5"]
|
[ext_resource type="Script" path="res://scripts/pipe.gd" id="1_akqs5"]
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_5w6v5"]
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_5w6v5"]
|
||||||
size = Vector2(30, 1)
|
size = Vector2(30, 2)
|
||||||
|
|
||||||
[node name="pipe" type="Area2D"]
|
[node name="pipe" type="Area2D"]
|
||||||
collision_layer = 4
|
collision_layer = 4
|
||||||
script = ExtResource("1_akqs5")
|
script = ExtResource("1_akqs5")
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
position = Vector2(16, -0.5)
|
position = Vector2(16, 0)
|
||||||
shape = SubResource("RectangleShape2D_5w6v5")
|
shape = SubResource("RectangleShape2D_5w6v5")
|
||||||
|
|||||||
+1
-1
@@ -177,7 +177,7 @@ animations = [{
|
|||||||
|
|
||||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_4sl4a"]
|
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_4sl4a"]
|
||||||
radius = 6.0
|
radius = 6.0
|
||||||
height = 16.0
|
height = 15.0
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_sqgi2"]
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_sqgi2"]
|
||||||
size = Vector2(8, 1)
|
size = Vector2(8, 1)
|
||||||
|
|||||||
+10
-1
@@ -1,5 +1,14 @@
|
|||||||
extends Area2D
|
extends Area2D
|
||||||
|
|
||||||
|
@export var load_level: String
|
||||||
|
@onready var animation_player = $AnimationPlayer
|
||||||
|
@onready var player = %player
|
||||||
|
|
||||||
|
|
||||||
func _on_body_entered(body):
|
func _on_body_entered(body):
|
||||||
pass
|
animation_player.play("change_scene")
|
||||||
|
player.on_pause = true
|
||||||
|
|
||||||
|
func load_new_scene():
|
||||||
|
get_tree().change_scene_to_file("res://scenes/levels/" + load_level + ".tscn")
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,9 @@ extends Area2D
|
|||||||
@onready var player = %player
|
@onready var player = %player
|
||||||
|
|
||||||
func _on_body_entered(body):
|
func _on_body_entered(body):
|
||||||
body.player_die()
|
player.shrink()
|
||||||
|
player.shrink()
|
||||||
|
player.shrink()
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
timer.start()
|
timer.start()
|
||||||
@@ -14,4 +16,6 @@ func _process(delta):
|
|||||||
label.text = x
|
label.text = x
|
||||||
|
|
||||||
func _on_timer_timeout():
|
func _on_timer_timeout():
|
||||||
player.player_die()
|
player.shrink()
|
||||||
|
player.shrink()
|
||||||
|
player.shrink()
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
extends RigidBody2D
|
||||||
|
|
||||||
|
@export var veloc : Vector2
|
||||||
|
|
||||||
|
func _physics_process(delta):
|
||||||
|
linear_velocity = veloc
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
extends Node2D
|
||||||
|
@onready var timer = $Timer
|
||||||
|
|
||||||
|
@export var obj : PackedScene
|
||||||
|
@export var delay : float
|
||||||
|
|
||||||
|
var instances = []
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
timer.wait_time = delay
|
||||||
|
timer.start()
|
||||||
|
|
||||||
|
func _on_timer_timeout():
|
||||||
|
var instance = obj.instantiate()
|
||||||
|
instance.position.x = 0
|
||||||
|
instance.position.y = 0
|
||||||
|
add_child(instance)
|
||||||
|
instances.append(instance)
|
||||||
|
|
||||||
|
if len(instances) > 5:
|
||||||
|
var curr = instances.pop_front()
|
||||||
|
curr.queue_free()
|
||||||
@@ -10,6 +10,7 @@ extends RigidBody2D
|
|||||||
@onready var ray_cast_right_2 = $RayCastRight2
|
@onready var ray_cast_right_2 = $RayCastRight2
|
||||||
var innocent = false
|
var innocent = false
|
||||||
@onready var timer_2 = $Timer2
|
@onready var timer_2 = $Timer2
|
||||||
|
@onready var gumba = $"."
|
||||||
|
|
||||||
func _physics_process(delta):
|
func _physics_process(delta):
|
||||||
linear_velocity.x = speed
|
linear_velocity.x = speed
|
||||||
@@ -41,11 +42,13 @@ func f_die():
|
|||||||
animated_sprite_2d.play("die")
|
animated_sprite_2d.play("die")
|
||||||
timer.start()
|
timer.start()
|
||||||
if die != null:
|
if die != null:
|
||||||
|
gumba.collision_layer = 32
|
||||||
die.queue_free()
|
die.queue_free()
|
||||||
die_sound.play()
|
die_sound.play()
|
||||||
ray_cast_left_2.queue_free()
|
ray_cast_left_2.queue_free()
|
||||||
ray_cast_right_2.queue_free()
|
ray_cast_right_2.queue_free()
|
||||||
|
|
||||||
|
|
||||||
func _on_die_body_entered(body):
|
func _on_die_body_entered(body):
|
||||||
f_die()
|
f_die()
|
||||||
body.velocity.y = body.JUMPt_velocity/1.5
|
body.velocity.y = body.JUMPt_velocity/1.5
|
||||||
|
|||||||
+8
-4
@@ -67,6 +67,8 @@ func _unhandled_input(event):
|
|||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
color_rect.visible = false
|
color_rect.visible = false
|
||||||
|
pipedetector_ground.position.y = 0
|
||||||
|
collision_shape_2d.shape.height = 15
|
||||||
|
|
||||||
func _process(delta):
|
func _process(delta):
|
||||||
# set camera
|
# set camera
|
||||||
@@ -89,7 +91,7 @@ func _process(delta):
|
|||||||
|
|
||||||
func _physics_process(delta):
|
func _physics_process(delta):
|
||||||
# Add the gravity.
|
# Add the gravity.
|
||||||
if not is_on_floor():
|
if not is_on_floor() and not on_pause:
|
||||||
velocity.y += gravity * delta
|
velocity.y += gravity * delta
|
||||||
|
|
||||||
# Handle jump.
|
# Handle jump.
|
||||||
@@ -151,17 +153,18 @@ func _physics_process(delta):
|
|||||||
else:
|
else:
|
||||||
velocity.x = move_toward(velocity.x, 0, SPEED)
|
velocity.x = move_toward(velocity.x, 0, SPEED)
|
||||||
|
|
||||||
|
if not on_pause:
|
||||||
move_and_slide()
|
move_and_slide()
|
||||||
|
|
||||||
func grow():
|
func grow():
|
||||||
if not is_big:
|
if not is_big:
|
||||||
is_big = true
|
is_big = true
|
||||||
collision_shape_2d.shape.height = 32
|
collision_shape_2d.shape.height = 31
|
||||||
pipedetector_ground.position.y += 8
|
pipedetector_ground.position.y += 8
|
||||||
|
|
||||||
func flower():
|
func flower():
|
||||||
if not is_big:
|
if not is_big:
|
||||||
collision_shape_2d.shape.height = 32
|
collision_shape_2d.shape.height = 31
|
||||||
pipedetector_ground.position.y += 8
|
pipedetector_ground.position.y += 8
|
||||||
is_big = true
|
is_big = true
|
||||||
is_flower = true
|
is_flower = true
|
||||||
@@ -172,7 +175,7 @@ func shrink():
|
|||||||
shrink_sound.play()
|
shrink_sound.play()
|
||||||
elif is_big:
|
elif is_big:
|
||||||
is_big = false
|
is_big = false
|
||||||
collision_shape_2d.shape.height = 16
|
collision_shape_2d.shape.height = 15
|
||||||
pipedetector_ground.position.y -= 8
|
pipedetector_ground.position.y -= 8
|
||||||
shrink_sound.play()
|
shrink_sound.play()
|
||||||
else:
|
else:
|
||||||
@@ -180,6 +183,7 @@ func shrink():
|
|||||||
|
|
||||||
func player_die():
|
func player_die():
|
||||||
die_player.play("die")
|
die_player.play("die")
|
||||||
|
on_pause = true
|
||||||
music.stop()
|
music.stop()
|
||||||
|
|
||||||
func reload_scene():
|
func reload_scene():
|
||||||
|
|||||||
Reference in New Issue
Block a user