From 728fbc69901ae602906f2eadc20e824024ae1ef7 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Wed, 19 Aug 2020 17:04:26 +0200 Subject: [PATCH] game1: replace goo with new goo emitter and go to next scene at end --- scenes/game1.tscn | 172 +++++------------------------------ scripts/game1/Game1Script.gd | 5 +- 2 files changed, 25 insertions(+), 152 deletions(-) diff --git a/scenes/game1.tscn b/scenes/game1.tscn index 98f6241..bca7771 100644 --- a/scenes/game1.tscn +++ b/scenes/game1.tscn @@ -1,31 +1,21 @@ -[gd_scene load_steps=36 format=2] +[gd_scene load_steps=21 format=2] [ext_resource path="res://images/game1/opening.tres" type="SpriteFrames" id=1] [ext_resource path="res://images/game1/opening2bg.tres" type="SpriteFrames" id=2] [ext_resource path="res://scripts/game1/Game1Script.gd" type="Script" id=3] [ext_resource path="res://scenes/SidePlayer.tscn" type="PackedScene" id=4] [ext_resource path="res://scripts/game1/opening2_next_step_trigger.gd" type="Script" id=5] -[ext_resource path="res://images/goo/BigGoo1.png" type="Texture" id=8] -[ext_resource path="res://images/goo/BigGoo1_Outlines.png" type="Texture" id=9] -[ext_resource path="res://images/goo/BigGoo2_Outlines.png" type="Texture" id=10] -[ext_resource path="res://images/goo/BigGoo2.png" type="Texture" id=11] -[ext_resource path="res://images/goo/goo.shader" type="Shader" id=12] -[ext_resource path="res://images/goo/goo1.png" type="Texture" id=13] -[ext_resource path="res://images/goo/goo1_Outlines.png" type="Texture" id=14] -[ext_resource path="res://images/goo/goo2_Outlines.png" type="Texture" id=15] -[ext_resource path="res://images/goo/goo3.png" type="Texture" id=16] -[ext_resource path="res://images/goo/goo2.png" type="Texture" id=17] -[ext_resource path="res://images/goo/goo3_Outlines.png" type="Texture" id=18] -[ext_resource path="res://images/goo/goo4.png" type="Texture" id=19] -[ext_resource path="res://images/goo/goo4_Outlines.png" type="Texture" id=20] -[ext_resource path="res://images/goo/goo5.png" type="Texture" id=21] -[ext_resource path="res://images/goo/goo5_Outlines.png" type="Texture" id=22] -[ext_resource path="res://images/goo/goo6_Outlines.png" type="Texture" id=23] -[ext_resource path="res://images/goo/goo6.png" type="Texture" id=24] -[ext_resource path="res://images/goo/goo7.png" type="Texture" id=25] -[ext_resource path="res://images/goo/goo7_Outlines.png" type="Texture" id=26] -[ext_resource path="res://images/goo/goo8.png" type="Texture" id=27] -[ext_resource path="res://images/goo/goo8_Outlines.png" type="Texture" id=28] +[ext_resource path="res://images/goo/goo5.tres" type="Resource" id=6] +[ext_resource path="res://images/goo/goo8.tres" type="Resource" id=7] +[ext_resource path="res://images/goo/goo4.tres" type="Resource" id=29] +[ext_resource path="res://images/goo/BigGoo2.tres" type="Resource" id=30] +[ext_resource path="res://images/goo/goo2.tres" type="Resource" id=31] +[ext_resource path="res://images/goo/goo7.tres" type="Resource" id=32] +[ext_resource path="res://images/goo/goo6.tres" type="Resource" id=33] +[ext_resource path="res://images/goo/BigGoo1.tres" type="Resource" id=34] +[ext_resource path="res://scripts/GooEmitter.gd" type="Script" id=35] +[ext_resource path="res://images/goo/goo1.tres" type="Resource" id=36] +[ext_resource path="res://images/goo/goo3.tres" type="Resource" id=37] [sub_resource type="RectangleShape2D" id=1] extents = Vector2( 114.063, 10 ) @@ -39,44 +29,6 @@ extents = Vector2( 13.4499, 41.9587 ) [sub_resource type="RectangleShape2D" id=4] extents = Vector2( 6.44203, 23.0973 ) -[sub_resource type="ShaderMaterial" id=5] -shader = ExtResource( 12 ) -shader_param/particles_anim_h_frames = 10 -shader_param/particles_anim_v_frames = 11 -shader_param/particles_anim_loop = true - -[sub_resource type="ParticlesMaterial" id=6] -emission_shape = 2 -emission_box_extents = Vector3( 10, 10, 1 ) -flag_disable_z = true -direction = Vector3( -1, 0, 0 ) -spread = 5.0 -gravity = Vector3( 0, 0, 0 ) -initial_velocity = 8.0 -orbit_velocity = 0.0 -orbit_velocity_random = 0.0 -anim_speed = 5.0 -anim_offset = 1.0 -anim_offset_random = 1.0 - -[sub_resource type="ShaderMaterial" id=7] -shader = ExtResource( 12 ) -shader_param/particles_anim_h_frames = 8 -shader_param/particles_anim_v_frames = 1 -shader_param/particles_anim_loop = true - -[sub_resource type="ShaderMaterial" id=8] -shader = ExtResource( 12 ) -shader_param/particles_anim_h_frames = 4 -shader_param/particles_anim_v_frames = 1 -shader_param/particles_anim_loop = true - -[sub_resource type="ShaderMaterial" id=9] -shader = ExtResource( 12 ) -shader_param/particles_anim_h_frames = 1 -shader_param/particles_anim_v_frames = 1 -shader_param/particles_anim_loop = true - [node name="Node2D" type="Node2D"] script = ExtResource( 3 ) @@ -130,97 +82,15 @@ root_path = NodePath("../..") position = Vector2( 210.738, 5 ) shape = SubResource( 4 ) -[node name="goo" type="Node2D" parent="Opening2"] - -[node name="BigGoo1" type="Particles2D" parent="Opening2/goo"] -material = SubResource( 5 ) -position = Vector2( 319.204, 26.7984 ) -amount = 3 -lifetime = 60.0 -process_material = SubResource( 6 ) -texture = ExtResource( 8 ) -normal_map = ExtResource( 9 ) - -[node name="BigGoo2" type="Particles2D" parent="Opening2/goo"] -material = SubResource( 7 ) -position = Vector2( 365.195, 26.7984 ) -amount = 2 -lifetime = 60.0 -process_material = SubResource( 6 ) -texture = ExtResource( 11 ) -normal_map = ExtResource( 10 ) - -[node name="goo1" type="Particles2D" parent="Opening2/goo"] -material = SubResource( 8 ) -position = Vector2( 337.648, 26.7984 ) -amount = 2 -lifetime = 60.0 -process_material = SubResource( 6 ) -texture = ExtResource( 13 ) -normal_map = ExtResource( 14 ) - -[node name="goo2" type="Particles2D" parent="Opening2/goo"] -material = SubResource( 8 ) -position = Vector2( 283.432, 26.7984 ) -amount = 2 -lifetime = 60.0 -process_material = SubResource( 6 ) -texture = ExtResource( 17 ) -normal_map = ExtResource( 15 ) - -[node name="goo3" type="Particles2D" parent="Opening2/goo"] -material = SubResource( 8 ) -position = Vector2( 328.372, 26.7984 ) -amount = 2 -lifetime = 60.0 -process_material = SubResource( 6 ) -texture = ExtResource( 16 ) -normal_map = ExtResource( 18 ) - -[node name="goo4" type="Particles2D" parent="Opening2/goo"] -material = SubResource( 9 ) -position = Vector2( 347.601, 26.7984 ) -amount = 2 -lifetime = 60.0 -process_material = SubResource( 6 ) -texture = ExtResource( 19 ) -normal_map = ExtResource( 20 ) - -[node name="goo5" type="Particles2D" parent="Opening2/goo"] -material = SubResource( 9 ) -position = Vector2( 302.537, 26.7984 ) -amount = 2 -lifetime = 60.0 -process_material = SubResource( 6 ) -texture = ExtResource( 21 ) -normal_map = ExtResource( 22 ) - -[node name="goo6" type="Particles2D" parent="Opening2/goo"] -material = SubResource( 9 ) -position = Vector2( 256.829, 26.7984 ) -amount = 2 -lifetime = 60.0 -process_material = SubResource( 6 ) -texture = ExtResource( 24 ) -normal_map = ExtResource( 23 ) - -[node name="goo7" type="Particles2D" parent="Opening2/goo"] -material = SubResource( 9 ) -position = Vector2( 218.7, 26.7984 ) -amount = 2 -lifetime = 60.0 -process_material = SubResource( 6 ) -texture = ExtResource( 25 ) -normal_map = ExtResource( 26 ) - -[node name="goo8" type="Particles2D" parent="Opening2/goo"] -material = SubResource( 9 ) -position = Vector2( 246.388, 26.7984 ) -amount = 2 -lifetime = 60.0 -process_material = SubResource( 6 ) -texture = ExtResource( 27 ) -normal_map = ExtResource( 28 ) +[node name="GooEmitter" type="Node2D" parent="Opening2"] +position = Vector2( 218.7, 26.2372 ) +script = ExtResource( 35 ) +__meta__ = { +"_editor_description_": "" +} +goo_particles = [ ExtResource( 34 ), ExtResource( 30 ), ExtResource( 36 ), ExtResource( 31 ), ExtResource( 37 ), ExtResource( 29 ), ExtResource( 6 ), ExtResource( 33 ), ExtResource( 32 ), ExtResource( 7 ) ] +direction = Vector2( -1, 0 ) +spawn_rate = 2 [node name="Opening1" type="AnimatedSprite" parent="."] frames = ExtResource( 1 ) diff --git a/scripts/game1/Game1Script.gd b/scripts/game1/Game1Script.gd index 870b8d5..38be5d2 100644 --- a/scripts/game1/Game1Script.gd +++ b/scripts/game1/Game1Script.gd @@ -1,6 +1,5 @@ extends Node - var playing = false onready var player_fab = preload('res://scenes/game1/Player.tscn') @@ -46,6 +45,10 @@ func next_level(): current_level += 1 + if current_level >= levels.size(): + get_tree().change_scene("res://scenes/oil_tanker.tscn") + return + # Prepare level var level = load("res://scenes/game1/" + levels[current_level] + ".tscn").instance() $Game.add_child(level)