diff --git a/dialogues/End_Truth.json b/dialogues/End_Truth.json index a2471f0..e7b2e7c 100644 --- a/dialogues/End_Truth.json +++ b/dialogues/End_Truth.json @@ -19,5 +19,39 @@ {"name": "Crab", "text": "..."}, {"name": "Crab", "text": "Why are you telling me the truth ?"}, {"name": "Ely", "text": "Sorry, wha-"}, - {"name": "Crab", "text": "I thought we were telling tales."} + {"name": "Crab", "text": "I thought we were telling tales."}, + {"name": "Ely", "text": "Y-yeah. That's true..."}, + {"name": "Ely", "text": "I don't know. I find it really hard to lie"}, + {"name": "Ely", "text": "Furthermore, I think it's better to tell what really happened."}, + {"name": "Crab", "text": "..."}, + {"name": "Crab", "text": "Is it really ?"}, + {"name": "Ely", "text": "What do you mean ?"}, + {"name": "Crab", "text": "What does it changes ? Is the world a better place now ?"}, + {"name": "Crab", "text": "Did you accomplish anything by telling the truth ?"}, + {"name": "Ely", "text": "I mean... Now you know it was hum-... hum... hoomans' fault."}, + {"name": "Crab", "text": "I already knew that and besides, what can I [wave amp=20 freq=2]do[wave/] with this knowledge ?"}, + {"name": "Ely", "text": "..."}, + {"name": "Ely", "text": "Nothing..."}, + {"name": "Ely", "text": "You're just..."}, + {"name": "Crab", "text": "a cute talking crab ?"}, + {"name": "Ely", "text": "Yeah... A cute talking crab."}, + {"name": "Ely", "text": "..."}, + {"name": "Ely", "text": "I'm sorry."}, + {"name": "Ely", "text": "I'm so sorry..."}, + {"name": "Crab", "text": "..."}, + {"name": "Crab", "text": "You said you were just trying to do your job and pay you rent."}, + {"name": "Ely", "text": "Yes true."}, + {"name": "Ely", "text": "But I'm still responsible."}, + {"name": "Ely", "text": "I-I shouldn't have pick this job. I know it's bad for the environnement."}, + {"name": "Ely", "text": "And I dislike the job, it's not a pleasure to participate in this system."}, + {"name": "Ely", "text": "Uh. Crap."}, + {"name": "Ely", "text": "I'm so sorry."}, + {"name": "Crab", "text": "..."}, + {"name": "Crab", "text": "You had to pick this job."}, + {"name": "Ely", "text": "... I suppose..."}, + {"name": "Ely", "text": "Yes... That was the only way to pay my bills."}, + {"name": "Crab", "text": "..."}, + {"name": "Crab", "text": "To be honest..."}, + {"name": "Crab", "text": "It's okay. You were in a system that requires you to take that job."}, + {"name": "Crab", "text": "If I had someone or something to blame or attack it could be you but "} ] diff --git a/images/oil_tanker/OilTankerLeak_Background.png b/images/oil_tanker/OilTankerLeak_Background.png new file mode 100644 index 0000000..ca50b24 Binary files /dev/null and b/images/oil_tanker/OilTankerLeak_Background.png differ diff --git a/images/oil_tanker/OilTankerLeak_Background.png.import b/images/oil_tanker/OilTankerLeak_Background.png.import new file mode 100644 index 0000000..afa9a3d --- /dev/null +++ b/images/oil_tanker/OilTankerLeak_Background.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/OilTankerLeak_Background.png-0c9b66bebe152e43e2790bbf7fdbebf5.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://images/oil_tanker/OilTankerLeak_Background.png" +dest_files=[ "res://.import/OilTankerLeak_Background.png-0c9b66bebe152e43e2790bbf7fdbebf5.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/images/oil_tanker/OilTankerLeak_Foreground.png b/images/oil_tanker/OilTankerLeak_Foreground.png new file mode 100644 index 0000000..d973da2 Binary files /dev/null and b/images/oil_tanker/OilTankerLeak_Foreground.png differ diff --git a/images/oil_tanker/OilTankerLeak_Foreground.png.import b/images/oil_tanker/OilTankerLeak_Foreground.png.import new file mode 100644 index 0000000..0332f6e --- /dev/null +++ b/images/oil_tanker/OilTankerLeak_Foreground.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/OilTankerLeak_Foreground.png-c096ce8f06fa538e579631fc6bf68519.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://images/oil_tanker/OilTankerLeak_Foreground.png" +dest_files=[ "res://.import/OilTankerLeak_Foreground.png-c096ce8f06fa538e579631fc6bf68519.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/images/oil_tanker/OilTankerLeak_Midground.png b/images/oil_tanker/OilTankerLeak_Midground.png new file mode 100644 index 0000000..e0343ff Binary files /dev/null and b/images/oil_tanker/OilTankerLeak_Midground.png differ diff --git a/images/oil_tanker/OilTankerLeak_Midground.png.import b/images/oil_tanker/OilTankerLeak_Midground.png.import new file mode 100644 index 0000000..7fc81dc --- /dev/null +++ b/images/oil_tanker/OilTankerLeak_Midground.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/OilTankerLeak_Midground.png-a590f651c67f3413524b83943044b1a9.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://images/oil_tanker/OilTankerLeak_Midground.png" +dest_files=[ "res://.import/OilTankerLeak_Midground.png-a590f651c67f3413524b83943044b1a9.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/images/oil_tanker/OilTankerLeak_Midground_GooMask.png b/images/oil_tanker/OilTankerLeak_Midground_GooMask.png new file mode 100644 index 0000000..479f63a Binary files /dev/null and b/images/oil_tanker/OilTankerLeak_Midground_GooMask.png differ diff --git a/images/oil_tanker/OilTankerLeak_Midground_GooMask.png.import b/images/oil_tanker/OilTankerLeak_Midground_GooMask.png.import new file mode 100644 index 0000000..89030c0 --- /dev/null +++ b/images/oil_tanker/OilTankerLeak_Midground_GooMask.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/OilTankerLeak_Midground_GooMask.png-13544a8ea729d77b6d159695d7231fb5.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://images/oil_tanker/OilTankerLeak_Midground_GooMask.png" +dest_files=[ "res://.import/OilTankerLeak_Midground_GooMask.png-13544a8ea729d77b6d159695d7231fb5.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/images/oil_tanker/oilTankerInside_Background.png b/images/oil_tanker/oilTankerInside_Background.png index 29bfa48..bdb51f5 100644 Binary files a/images/oil_tanker/oilTankerInside_Background.png and b/images/oil_tanker/oilTankerInside_Background.png differ diff --git a/images/oil_tanker/oilTankerInside_Foreground.png b/images/oil_tanker/oilTankerInside_Foreground.png index 0432c13..5ecf344 100644 Binary files a/images/oil_tanker/oilTankerInside_Foreground.png and b/images/oil_tanker/oilTankerInside_Foreground.png differ diff --git a/scenes/SidePlayer.tscn b/scenes/SidePlayer.tscn index d227307..1561420 100644 --- a/scenes/SidePlayer.tscn +++ b/scenes/SidePlayer.tscn @@ -10,6 +10,7 @@ extents = Vector2( 10, 4.5 ) position = Vector2( 1, -1 ) mode = 2 gravity_scale = 0.0 +sleeping = true linear_damp = 25.0 script = ExtResource( 2 ) diff --git a/scenes/oil_tanker.tscn b/scenes/oil_tanker.tscn index 79b6fe6..8c9e355 100644 --- a/scenes/oil_tanker.tscn +++ b/scenes/oil_tanker.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=28 format=2] +[gd_scene load_steps=35 format=2] [ext_resource path="res://scripts/oil_tanker.gd" type="Script" id=1] [ext_resource path="res://images/oil_tanker/OilTanker.tres" type="SpriteFrames" id=2] @@ -6,10 +6,7 @@ [ext_resource path="res://scenes/SidePlayer.tscn" type="PackedScene" id=4] [ext_resource path="res://images/oil_tanker/oilTankerInside_Foreground.png" type="Texture" id=5] [ext_resource path="res://scripts/GooEmitter.gd" type="Script" id=6] -[ext_resource path="res://images/goo/goo.shader" type="Shader" id=7] [ext_resource path="res://images/goo/BigGoo1.tres" type="Resource" id=8] -[ext_resource path="res://images/goo/BigGoo1.png" type="Texture" id=9] -[ext_resource path="res://images/goo/BigGoo1_Outlines.png" type="Texture" id=10] [ext_resource path="res://images/goo/BigGoo2.tres" type="Resource" id=11] [ext_resource path="res://images/goo/goo5.tres" type="Resource" id=12] [ext_resource path="res://images/goo/goo8.tres" type="Resource" id=13] @@ -19,50 +16,169 @@ [ext_resource path="res://images/goo/goo6.tres" type="Resource" id=17] [ext_resource path="res://images/goo/goo1.tres" type="Resource" id=18] [ext_resource path="res://images/goo/goo3.tres" type="Resource" id=19] +[ext_resource path="res://images/oil_tanker/OilTankerLeak_Background.png" type="Texture" id=20] +[ext_resource path="res://images/oil_tanker/OilTankerLeak_Foreground.png" type="Texture" id=21] +[ext_resource path="res://images/oil_tanker/OilTankerLeak_Midground.png" type="Texture" id=22] +[ext_resource path="res://images/oil_tanker/OilTankerLeak_Midground_GooMask.png" type="Texture" id=23] [sub_resource type="RectangleShape2D" id=1] -extents = Vector2( 10, 27.9493 ) +extents = Vector2( 10, 34.563 ) [sub_resource type="RectangleShape2D" id=2] -extents = Vector2( 10, 27.9493 ) +extents = Vector2( 10, 34.563 ) [sub_resource type="RectangleShape2D" id=3] -extents = Vector2( 20.5315, 7.16187 ) +extents = Vector2( 276.861, 9.9101 ) [sub_resource type="RectangleShape2D" id=4] +extents = Vector2( 276.861, 9.9101 ) + +[sub_resource type="RectangleShape2D" id=15] +extents = Vector2( 175.74, 9.07445 ) + +[sub_resource type="CircleShape2D" id=16] +radius = 31.4057 + +[sub_resource type="RectangleShape2D" id=7] +extents = Vector2( 10, 27.9493 ) + +[sub_resource type="RectangleShape2D" id=8] +extents = Vector2( 10, 27.9493 ) + +[sub_resource type="RectangleShape2D" id=9] +extents = Vector2( 20.5315, 7.16187 ) + +[sub_resource type="RectangleShape2D" id=10] extents = Vector2( 85.2849, 7.16187 ) -[sub_resource type="SegmentShape2D" id=5] -b = Vector2( -77.3156, 35.1986 ) +[sub_resource type="SegmentShape2D" id=11] +b = Vector2( 70.2283, 33.9024 ) -[sub_resource type="SegmentShape2D" id=6] -b = Vector2( -129.208, -5.53812 ) +[sub_resource type="SegmentShape2D" id=12] +b = Vector2( 122.205, -7.65517 ) -[sub_resource type="SegmentShape2D" id=7] -b = Vector2( -87.4343, 42.6051 ) +[sub_resource type="SegmentShape2D" id=13] +b = Vector2( 107.673, 44.0238 ) -[sub_resource type="ShaderMaterial" id=10] -shader = ExtResource( 7 ) -shader_param/particles_anim_h_frames = 10 -shader_param/particles_anim_v_frames = 11 -shader_param/particles_anim_loop = true -shader_param/frame = null +[sub_resource type="RectangleShape2D" id=14] +extents = Vector2( 4.85875, 16.0913 ) [node name="Node2D" type="Node2D"] script = ExtResource( 1 ) +[node name="InsideOilTanker2" type="Sprite" parent="."] +texture = ExtResource( 20 ) +centered = false + +[node name="Camera2D" type="Camera2D" parent="InsideOilTanker2"] +anchor_mode = 0 + +[node name="Player" parent="InsideOilTanker2" instance=ExtResource( 4 )] +position = Vector2( 1.05231, 91.7763 ) +collision_layer = 4 +collision_mask = 4 + +[node name="Parallax" type="Node2D" parent="InsideOilTanker2"] + +[node name="Prop2" type="Sprite" parent="InsideOilTanker2/Parallax"] +texture = ExtResource( 22 ) +centered = false + +[node name="GooEmitter2" type="Node2D" parent="InsideOilTanker2/Parallax/Prop2"] +position = Vector2( 355.334, 55.192 ) +script = ExtResource( 6 ) +goo_particles = [ ExtResource( 8 ), ExtResource( 11 ), ExtResource( 18 ), ExtResource( 15 ), ExtResource( 19 ), ExtResource( 14 ), ExtResource( 12 ), ExtResource( 17 ), ExtResource( 16 ), ExtResource( 13 ) ] +direction = Vector2( -1, 0 ) +spawn_radius = 16 +despawn_radius = 600 + +[node name="Mask" type="Sprite" parent="InsideOilTanker2/Parallax/Prop2"] +texture = ExtResource( 23 ) +centered = false + +[node name="Prop1" type="Sprite" parent="InsideOilTanker2/Parallax"] +texture = ExtResource( 21 ) +centered = false + +[node name="walls" type="Node2D" parent="InsideOilTanker2"] + +[node name="Wall" type="StaticBody2D" parent="InsideOilTanker2/walls"] +collision_layer = 2147483652 +collision_mask = 4 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="InsideOilTanker2/walls/Wall"] +position = Vector2( -23.7448, 88.1799 ) +shape = SubResource( 1 ) + +[node name="Wall4" type="StaticBody2D" parent="InsideOilTanker2/walls"] +collision_layer = 2147483652 +collision_mask = 4 +__meta__ = { +"_editor_description_": "" +} + +[node name="CollisionShape2D" type="CollisionShape2D" parent="InsideOilTanker2/walls/Wall4"] +position = Vector2( 520.202, 91.1098 ) +shape = SubResource( 2 ) + +[node name="Wall2" type="StaticBody2D" parent="InsideOilTanker2/walls"] +collision_layer = 2147483652 +collision_mask = 4 +__meta__ = { +"_editor_description_": "" +} + +[node name="CollisionShape2D" type="CollisionShape2D" parent="InsideOilTanker2/walls/Wall2"] +position = Vector2( 249.14, 122.296 ) +shape = SubResource( 3 ) + +[node name="Wall3" type="StaticBody2D" parent="InsideOilTanker2/walls"] +collision_layer = 2147483652 +collision_mask = 4 +__meta__ = { +"_editor_description_": "" +} + +[node name="CollisionShape2D" type="CollisionShape2D" parent="InsideOilTanker2/walls/Wall3"] +position = Vector2( 244.468, 58.9552 ) +shape = SubResource( 4 ) + +[node name="Wall5" type="StaticBody2D" parent="InsideOilTanker2/walls"] +collision_layer = 2147483652 +collision_mask = 4 +__meta__ = { +"_editor_description_": "" +} + +[node name="CollisionShape2D" type="CollisionShape2D" parent="InsideOilTanker2/walls/Wall5"] +position = Vector2( 342.076, 75.064 ) +rotation = 0.0123712 +shape = SubResource( 15 ) + +[node name="Wall6" type="StaticBody2D" parent="InsideOilTanker2/walls"] +collision_layer = 2147483652 +collision_mask = 4 +__meta__ = { +"_editor_description_": "" +} + +[node name="CollisionShape2D" type="CollisionShape2D" parent="InsideOilTanker2/walls/Wall6"] +position = Vector2( 168.01, 51.7275 ) +rotation = 0.0123712 +shape = SubResource( 16 ) + [node name="InsideOilTanker" type="Sprite" parent="."] texture = ExtResource( 3 ) centered = false [node name="Player" parent="InsideOilTanker" instance=ExtResource( 4 )] -position = Vector2( 192, 64.4552 ) +position = Vector2( -1.71286, 64.9552 ) [node name="GooEmitter" type="Node2D" parent="InsideOilTanker"] -position = Vector2( -43.5548, 47.7155 ) +position = Vector2( 208.261, 55.1923 ) script = ExtResource( 6 ) goo_particles = [ ExtResource( 8 ), ExtResource( 11 ), ExtResource( 18 ), ExtResource( 15 ), ExtResource( 19 ), ExtResource( 14 ), ExtResource( 12 ), ExtResource( 17 ), ExtResource( 16 ), ExtResource( 13 ) ] -direction = Vector2( 1, 0 ) +direction = Vector2( -1, 0 ) spawn_rate = 2 [node name="Foreground" type="Sprite" parent="InsideOilTanker"] @@ -74,52 +190,51 @@ centered = false [node name="Wall" type="StaticBody2D" parent="InsideOilTanker/walls"] [node name="CollisionShape2D" type="CollisionShape2D" parent="InsideOilTanker/walls/Wall"] -position = Vector2( 212.356, 79.3663 ) -shape = SubResource( 1 ) +position = Vector2( 208.261, 91.1098 ) +shape = SubResource( 7 ) [node name="Wall2" type="StaticBody2D" parent="InsideOilTanker/walls"] [node name="CollisionShape2D" type="CollisionShape2D" parent="InsideOilTanker/walls/Wall2"] -position = Vector2( -22.7999, 91.1098 ) -shape = SubResource( 2 ) +position = Vector2( -23.7448, 81.6604 ) +shape = SubResource( 8 ) [node name="Wall5" type="StaticBody2D" parent="InsideOilTanker/walls"] [node name="CollisionShape2D" type="CollisionShape2D" parent="InsideOilTanker/walls/Wall5"] -position = Vector2( 195.122, 51.255 ) -shape = SubResource( 3 ) +position = Vector2( 6.44882, 51.7275 ) +shape = SubResource( 9 ) [node name="Wall6" type="StaticBody2D" parent="InsideOilTanker/walls"] [node name="CollisionShape2D" type="CollisionShape2D" parent="InsideOilTanker/walls/Wall6"] -position = Vector2( 61.9836, 120.029 ) -shape = SubResource( 4 ) +position = Vector2( 127.185, 119.399 ) +shape = SubResource( 10 ) [node name="Wall7" type="StaticBody2D" parent="InsideOilTanker/walls"] [node name="CollisionShape2D" type="CollisionShape2D" parent="InsideOilTanker/walls/Wall7"] -position = Vector2( 188.054, 51.255 ) -shape = SubResource( 5 ) +position = Vector2( 10.2871, 55.1923 ) +shape = SubResource( 11 ) [node name="Wall9" type="StaticBody2D" parent="InsideOilTanker/walls"] [node name="CollisionShape2D" type="CollisionShape2D" parent="InsideOilTanker/walls/Wall9"] -position = Vector2( 111.845, 85.2935 ) -shape = SubResource( 6 ) +position = Vector2( 79.5423, 88.1799 ) +shape = SubResource( 12 ) [node name="Wall10" type="StaticBody2D" parent="InsideOilTanker/walls"] [node name="CollisionShape2D" type="CollisionShape2D" parent="InsideOilTanker/walls/Wall10"] -position = Vector2( 204.978, 72.7017 ) -shape = SubResource( 7 ) +position = Vector2( -15.3507, 75.064 ) +shape = SubResource( 13 ) + +[node name="NextTrigger" type="Area2D" parent="InsideOilTanker"] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="InsideOilTanker/NextTrigger"] +position = Vector2( 197.689, 97.7763 ) +shape = SubResource( 14 ) [node name="OilTanker" type="AnimatedSprite" parent="."] frames = ExtResource( 2 ) centered = false - -[node name="GooExample" type="Sprite" parent="."] -visible = false -material = SubResource( 10 ) -texture = ExtResource( 9 ) -normal_map = ExtResource( 10 ) -centered = false diff --git a/scripts/game1/Game1Script.gd b/scripts/game1/Game1Script.gd index 38be5d2..79b5792 100644 --- a/scripts/game1/Game1Script.gd +++ b/scripts/game1/Game1Script.gd @@ -32,6 +32,7 @@ func _ready(): $Opening1.play('default') yield($Opening1, 'animation_finished') $Opening1.queue_free() + $Opening2/Player.sleep = false func start_game(): # Hide opening diff --git a/scripts/game1/PlayerController.gd b/scripts/game1/PlayerController.gd index d2b3fe9..47fdb42 100644 --- a/scripts/game1/PlayerController.gd +++ b/scripts/game1/PlayerController.gd @@ -3,29 +3,43 @@ extends RigidBody2D var dir = Vector2(0, 0) +var sleep = true + +var input_right = false +var input_left = false +var input_up = false +var input_down = false + func _input(event): - var x = 0 - var y = 0 + if sleep: return + if event.is_action_pressed('left'): - x -= 1 + input_left = true if event.is_action_released('left'): - x += 1 + input_left = false if event.is_action_pressed('right'): - x += 1 + input_right = true if event.is_action_released('right'): - x -= 1 + input_right = false if event.is_action_pressed('up'): - y -= 1 + input_up = true if event.is_action_released('up'): - y += 1 + input_up = false if event.is_action_pressed('down'): - y += 1 + input_down = true if event.is_action_released('down'): - y -= 1 + input_down = false - dir.x += x - dir.y += y + var x = 0 + var y = 0 + + if input_left: x -= 1 + if input_right: x += 1 + if input_up: y -= 1 + if input_down: y += 1 + + dir = Vector2(x, y) func _process(delta): if linear_velocity.length_squared() < 1: diff --git a/scripts/oil_tanker.gd b/scripts/oil_tanker.gd index 3ac5cba..02b73b4 100644 --- a/scripts/oil_tanker.gd +++ b/scripts/oil_tanker.gd @@ -1,26 +1,48 @@ extends Node2D -onready var oil_tanker = $OilTanker +# 2 +onready var oil_tanker_inside_2 = $InsideOilTanker2 +onready var camera = $InsideOilTanker2/Camera2D +onready var player = $InsideOilTanker2/Player func _ready(): - oil_tanker.connect('animation_finished', self, 'end_oil_tanker') + $OilTanker.connect('animation_finished', self, 'end_oil_tanker') + $InsideOilTanker/NextTrigger.connect("body_entered", self, 'end_inside_oil_tanker') + +# $OilTanker.frame = 12 +# end_oil_tanker() +# end_inside_oil_tanker($InsideOilTanker/Player) func end_oil_tanker(): - print('oil_tanker.frame') - if oil_tanker.frame > 1: - oil_tanker.hide() + print('end_oil_tanker') + if $OilTanker.frame > 1: + $OilTanker.queue_free() + $InsideOilTanker/Player.sleep = false + +func end_inside_oil_tanker(body : Node): + print('end_inside_oil_tanker') + if body.name == "Player": + $InsideOilTanker.queue_free() + $InsideOilTanker2/Player.sleep = false + $InsideOilTanker2/Camera2D.current = true func _input(event): - if oil_tanker.visible: + if $OilTanker != null: if event.is_action_pressed('right'): - if !oil_tanker.is_playing(): - oil_tanker.play('default') + if !$OilTanker.is_playing(): + $OilTanker.play('default') if event.is_action_released('right'): - oil_tanker.stop() + $OilTanker.stop() if event.is_action_pressed('left'): - if !oil_tanker.is_playing() && oil_tanker.frame > 0: - oil_tanker.play('default', true) + if !$OilTanker.is_playing() && $OilTanker.frame > 0: + $OilTanker.play('default', true) if event.is_action_released('left'): - oil_tanker.stop() + $OilTanker.stop() +func _process(delta): + if !$InsideOilTanker2/Player.sleep: + var screen_width = ProjectSettings.get_setting("display/window/size/width") + camera.position.x = floor(clamp(player.position.x - screen_width / 2.0, 0, oil_tanker_inside_2.texture.get_width() - screen_width)) + $InsideOilTanker2/Parallax/Prop2.position.x = floor((260 - camera.position.x) * 0.5) + $InsideOilTanker2/Parallax/Prop1.position.x = floor((300 - camera.position.x) * 0.75)