y order and level execution from menu
This commit is contained in:
parent
84396d8393
commit
1631bd87ce
5 changed files with 32 additions and 20 deletions
|
|
@ -833,7 +833,7 @@ metadata/_edit_lock_ = true
|
||||||
|
|
||||||
[node name="RightLowerLeg" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/RightUpperLeg"]
|
[node name="RightLowerLeg" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/RightUpperLeg"]
|
||||||
position = Vector2(-2, 12)
|
position = Vector2(-2, 12)
|
||||||
scale = Vector2(0.999837, 0.999837)
|
scale = Vector2(0.999835, 0.999835)
|
||||||
rest = Transform2D(1, 0, 0, 1, -2, 12)
|
rest = Transform2D(1, 0, 0, 1, -2, 12)
|
||||||
editor_settings/show_bone_gizmo = false
|
editor_settings/show_bone_gizmo = false
|
||||||
|
|
||||||
|
|
@ -862,7 +862,7 @@ metadata/_edit_lock_ = true
|
||||||
[node name="LeftUpperLeg" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt"]
|
[node name="LeftUpperLeg" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt"]
|
||||||
use_parent_material = true
|
use_parent_material = true
|
||||||
position = Vector2(6, 4)
|
position = Vector2(6, 4)
|
||||||
scale = Vector2(0.99983, 0.99983)
|
scale = Vector2(0.999831, 0.999831)
|
||||||
rest = Transform2D(1, 0, 0, 1, 6, 4)
|
rest = Transform2D(1, 0, 0, 1, 6, 4)
|
||||||
editor_settings/show_bone_gizmo = false
|
editor_settings/show_bone_gizmo = false
|
||||||
|
|
||||||
|
|
@ -886,7 +886,7 @@ metadata/_edit_lock_ = true
|
||||||
|
|
||||||
[node name="LeftFoot" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/LeftUpperLeg/LeftLowerLeg"]
|
[node name="LeftFoot" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/LeftUpperLeg/LeftLowerLeg"]
|
||||||
position = Vector2(6, 10)
|
position = Vector2(6, 10)
|
||||||
scale = Vector2(0.999827, 0.999827)
|
scale = Vector2(0.999828, 0.999828)
|
||||||
rest = Transform2D(1, 0, 0, 1, 6, 10)
|
rest = Transform2D(1, 0, 0, 1, 6, 10)
|
||||||
auto_calculate_length_and_angle = false
|
auto_calculate_length_and_angle = false
|
||||||
length = 12.0
|
length = 12.0
|
||||||
|
|
@ -956,7 +956,7 @@ metadata/_edit_lock_ = true
|
||||||
|
|
||||||
[node name="Tie" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body"]
|
[node name="Tie" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body"]
|
||||||
position = Vector2(-9, -21)
|
position = Vector2(-9, -21)
|
||||||
rotation = 0.0104011
|
rotation = -0.0224817
|
||||||
skew = -0.000424862
|
skew = -0.000424862
|
||||||
rest = Transform2D(1, 0, 0, 1, -9, -21)
|
rest = Transform2D(1, 0, 0, 1, -9, -21)
|
||||||
auto_calculate_length_and_angle = false
|
auto_calculate_length_and_angle = false
|
||||||
|
|
@ -995,6 +995,7 @@ metadata/_edit_lock_ = true
|
||||||
|
|
||||||
[node name="Right_Eye" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/HeadParticle/Head"]
|
[node name="Right_Eye" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/HeadParticle/Head"]
|
||||||
position = Vector2(-16, -8)
|
position = Vector2(-16, -8)
|
||||||
|
scale = Vector2(1, 1)
|
||||||
texture = SubResource("AtlasTexture_vcc72")
|
texture = SubResource("AtlasTexture_vcc72")
|
||||||
centered = false
|
centered = false
|
||||||
offset = Vector2(-2, -2)
|
offset = Vector2(-2, -2)
|
||||||
|
|
@ -1002,15 +1003,16 @@ metadata/_edit_lock_ = true
|
||||||
|
|
||||||
[node name="Left_Eye" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/HeadParticle/Head"]
|
[node name="Left_Eye" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/HeadParticle/Head"]
|
||||||
position = Vector2(-4, -9)
|
position = Vector2(-4, -9)
|
||||||
|
scale = Vector2(1, 1)
|
||||||
texture = SubResource("AtlasTexture_kto0i")
|
texture = SubResource("AtlasTexture_kto0i")
|
||||||
centered = false
|
centered = false
|
||||||
offset = Vector2(-2, -2)
|
offset = Vector2(-2, -2)
|
||||||
metadata/_edit_lock_ = true
|
metadata/_edit_lock_ = true
|
||||||
|
|
||||||
[node name="Jaw" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/HeadParticle/Head"]
|
[node name="Jaw" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/HeadParticle/Head"]
|
||||||
position = Vector2(-3.00013, 2.99978)
|
position = Vector2(-2.69548, 2.26436)
|
||||||
rotation = 0.00100939
|
rotation = 0.0270693
|
||||||
scale = Vector2(0.999832, 0.999832)
|
scale = Vector2(0.999831, 0.999831)
|
||||||
texture = SubResource("AtlasTexture_x5uj2")
|
texture = SubResource("AtlasTexture_x5uj2")
|
||||||
centered = false
|
centered = false
|
||||||
offset = Vector2(-12, -2)
|
offset = Vector2(-12, -2)
|
||||||
|
|
@ -1083,7 +1085,7 @@ minTorque = -45.0
|
||||||
maxTorque = 45.0
|
maxTorque = 45.0
|
||||||
|
|
||||||
[node name="Left_Lower_Arm" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/HandProjectile"]
|
[node name="Left_Lower_Arm" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/HandProjectile"]
|
||||||
rotation = 0.0097793
|
rotation = 0.110272
|
||||||
scale = Vector2(0.999998, 0.999998)
|
scale = Vector2(0.999998, 0.999998)
|
||||||
texture = SubResource("AtlasTexture_auqeq")
|
texture = SubResource("AtlasTexture_auqeq")
|
||||||
centered = false
|
centered = false
|
||||||
|
|
@ -1093,7 +1095,7 @@ metadata/_edit_lock_ = true
|
||||||
[node name="Left_Hand" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/HandProjectile/Left_Lower_Arm"]
|
[node name="Left_Hand" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/HandProjectile/Left_Lower_Arm"]
|
||||||
show_behind_parent = true
|
show_behind_parent = true
|
||||||
position = Vector2(-0.99983, 12.9978)
|
position = Vector2(-0.99983, 12.9978)
|
||||||
rotation = -0.00431598
|
rotation = -0.115743
|
||||||
scale = Vector2(0.999658, 0.999658)
|
scale = Vector2(0.999658, 0.999658)
|
||||||
texture = SubResource("AtlasTexture_vlvtp")
|
texture = SubResource("AtlasTexture_vlvtp")
|
||||||
centered = false
|
centered = false
|
||||||
|
|
@ -1116,7 +1118,7 @@ editor_settings/show_bone_gizmo = false
|
||||||
|
|
||||||
[node name="LeftHand" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/LeftLowerArm"]
|
[node name="LeftHand" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/LeftLowerArm"]
|
||||||
position = Vector2(-1, 13)
|
position = Vector2(-1, 13)
|
||||||
scale = Vector2(0.999827, 0.999827)
|
scale = Vector2(0.999828, 0.999828)
|
||||||
rest = Transform2D(1, 0, 0, 1, -1, 13)
|
rest = Transform2D(1, 0, 0, 1, -1, 13)
|
||||||
auto_calculate_length_and_angle = false
|
auto_calculate_length_and_angle = false
|
||||||
length = 6.0
|
length = 6.0
|
||||||
|
|
@ -1166,6 +1168,7 @@ entity = NodePath("..")
|
||||||
[node name="Mover" type="Node" parent="."]
|
[node name="Mover" type="Node" parent="."]
|
||||||
script = ExtResource("4_u5syx")
|
script = ExtResource("4_u5syx")
|
||||||
_speed = SubResource("Resource_ckb7n")
|
_speed = SubResource("Resource_ckb7n")
|
||||||
|
_speedControlMult = 2.31566
|
||||||
|
|
||||||
[node name="HitPlayer" type="Node" parent="."]
|
[node name="HitPlayer" type="Node" parent="."]
|
||||||
script = ExtResource("12_he8da")
|
script = ExtResource("12_he8da")
|
||||||
|
|
|
||||||
|
|
@ -206,7 +206,7 @@ tracks/1/keys = {
|
||||||
"times": PackedFloat32Array(0),
|
"times": PackedFloat32Array(0),
|
||||||
"transitions": PackedFloat32Array(1),
|
"transitions": PackedFloat32Array(1),
|
||||||
"update": 0,
|
"update": 0,
|
||||||
"values": [0.0]
|
"values": [1.0]
|
||||||
}
|
}
|
||||||
tracks/2/type = "value"
|
tracks/2/type = "value"
|
||||||
tracks/2/imported = false
|
tracks/2/imported = false
|
||||||
|
|
@ -218,7 +218,7 @@ tracks/2/keys = {
|
||||||
"times": PackedFloat32Array(0),
|
"times": PackedFloat32Array(0),
|
||||||
"transitions": PackedFloat32Array(1),
|
"transitions": PackedFloat32Array(1),
|
||||||
"update": 0,
|
"update": 0,
|
||||||
"values": [1.0]
|
"values": [2.0]
|
||||||
}
|
}
|
||||||
tracks/3/type = "value"
|
tracks/3/type = "value"
|
||||||
tracks/3/imported = false
|
tracks/3/imported = false
|
||||||
|
|
@ -281,6 +281,8 @@ metadata/_edit_lock_ = true
|
||||||
|
|
||||||
[node name="ChooseYourSeeds" parent="GUI" index="0"]
|
[node name="ChooseYourSeeds" parent="GUI" index="0"]
|
||||||
anchors_preset = -1
|
anchors_preset = -1
|
||||||
|
anchor_top = 1.0
|
||||||
|
anchor_bottom = 2.0
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
|
|
||||||
|
|
@ -326,6 +328,7 @@ approachNotificationTime = 5.0
|
||||||
one_shot = true
|
one_shot = true
|
||||||
|
|
||||||
[node name="ZombieLevelPrevewer" type="Node2D" parent="." index="16"]
|
[node name="ZombieLevelPrevewer" type="Node2D" parent="." index="16"]
|
||||||
|
y_sort_enabled = true
|
||||||
position = Vector2(855, 76)
|
position = Vector2(855, 76)
|
||||||
script = ExtResource("7_8ajos")
|
script = ExtResource("7_8ajos")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
|
using Newlon.Components.Level;
|
||||||
|
|
||||||
namespace Newlon;
|
namespace Newlon;
|
||||||
|
|
||||||
|
|
@ -21,21 +22,24 @@ public partial class LevelController : Node
|
||||||
{
|
{
|
||||||
Instance = null;
|
Instance = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="levelTileset">Scene that will be loaded</param>
|
/// <param name="levelTileset">Scene that will be loaded</param>
|
||||||
/// <param name="levelScript">Optional script that will be attached to loaded scene</param>
|
/// <param name="levelResource">Execution of level</param>
|
||||||
public void StartLevel(PackedScene levelTileset, Script levelScript = null)
|
public void StartLevel(PackedScene levelTileset, AdventureLevelResource levelResource)
|
||||||
{
|
{
|
||||||
if (_isLevelRunning)
|
if (_isLevelRunning)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
GetTree().CreateTimer(0.001).Timeout += ()=>
|
||||||
|
{
|
||||||
|
RuntimeLevelData.Instance.levelResource = levelResource;
|
||||||
|
RuntimeLevelData.Instance.StartLevel();
|
||||||
|
};
|
||||||
|
|
||||||
GetTree().ChangeSceneToPacked(levelTileset);
|
GetTree().ChangeSceneToPacked(levelTileset);
|
||||||
|
|
||||||
if (levelScript != null)
|
|
||||||
GetTree().CurrentScene.SetScript(levelScript);
|
|
||||||
|
|
||||||
_isLevelRunning = true;
|
_isLevelRunning = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ extends Node
|
||||||
|
|
||||||
|
|
||||||
func _on_play_button_pressed() -> void:
|
func _on_play_button_pressed() -> void:
|
||||||
get_tree().change_scene_to_file("res://scenes/prototype_survival.tscn")
|
LevelController.call("StartLevel",preload("uid://bu0dh5ct387xu"),preload("uid://br3364jty1j0i"))
|
||||||
$ChannelPlayer.call("Play")
|
$ChannelPlayer.call("Play")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,9 +36,11 @@ public partial class RuntimeLevelData : Node
|
||||||
Instance = this;
|
Instance = this;
|
||||||
GetTree().Paused = true;
|
GetTree().Paused = true;
|
||||||
Engine.TimeScale = 1.0;
|
Engine.TimeScale = 1.0;
|
||||||
|
}
|
||||||
|
public void StartLevel()
|
||||||
|
{
|
||||||
SetLevelState(LevelStates.ChooseYourSeeds);
|
SetLevelState(LevelStates.ChooseYourSeeds);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Sun
|
#region Sun
|
||||||
public void AddSun(float amount)
|
public void AddSun(float amount)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue