scene manager
This commit is contained in:
34
model/Car1.png.import
Normal file
34
model/Car1.png.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://cdunb77p5rpwa"
|
||||||
|
path="res://.godot/imported/Car1.png-fb058f1749727e9d1262d2ea69ddb392.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://model/Car1.png"
|
||||||
|
dest_files=["res://.godot/imported/Car1.png-fb058f1749727e9d1262d2ea69ddb392.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
|
||||||
34
model/Car2.png.import
Normal file
34
model/Car2.png.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://cmtpp8aejspqd"
|
||||||
|
path="res://.godot/imported/Car2.png-687e66777bda54014b2b0caf5bc2df59.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://model/Car2.png"
|
||||||
|
dest_files=["res://.godot/imported/Car2.png-687e66777bda54014b2b0caf5bc2df59.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
|
||||||
34
model/Car3.png.import
Normal file
34
model/Car3.png.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://d3bxjeob51psa"
|
||||||
|
path="res://.godot/imported/Car3.png-8b0e16b9ac49f4d491c87dfadc8219aa.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://model/Car3.png"
|
||||||
|
dest_files=["res://.godot/imported/Car3.png-8b0e16b9ac49f4d491c87dfadc8219aa.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
|
||||||
34
model/Car4.png.import
Normal file
34
model/Car4.png.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://br6gyyxy5yo2e"
|
||||||
|
path="res://.godot/imported/Car4.png-b732dd9c3dc2f72a5fb63f9b9d653f9c.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://model/Car4.png"
|
||||||
|
dest_files=["res://.godot/imported/Car4.png-b732dd9c3dc2f72a5fb63f9b9d653f9c.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
|
||||||
34
model/Car5.png.import
Normal file
34
model/Car5.png.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://c8vfx50pepr6q"
|
||||||
|
path="res://.godot/imported/Car5.png-bcbf69a7a17e3fa546fd29d6899a5159.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://model/Car5.png"
|
||||||
|
dest_files=["res://.godot/imported/Car5.png-bcbf69a7a17e3fa546fd29d6899a5159.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
|
||||||
34
model/Car6.png.import
Normal file
34
model/Car6.png.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://d0tovjqwhq5xy"
|
||||||
|
path="res://.godot/imported/Car6.png-733f8482d306f586ac32480d37582dd4.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://model/Car6.png"
|
||||||
|
dest_files=["res://.godot/imported/Car6.png-733f8482d306f586ac32480d37582dd4.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
|
||||||
@@ -11,7 +11,7 @@ config_version=5
|
|||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="Mal-Adresse"
|
config/name="Mal-Adresse"
|
||||||
run/main_scene="res://scene/principal.tscn"
|
run/main_scene="res://scene/scene_manager.tscn"
|
||||||
config/features=PackedStringArray("4.3", "C#", "Forward Plus")
|
config/features=PackedStringArray("4.3", "C#", "Forward Plus")
|
||||||
config/icon="res://icon.svg"
|
config/icon="res://icon.svg"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=34 format=3 uid="uid://4ubk6w44h4s2"]
|
[gd_scene load_steps=33 format=3 uid="uid://4ubk6w44h4s2"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://script/Player.cs" id="1_gmlsd"]
|
[ext_resource type="Script" path="res://script/Player.cs" id="1_gmlsd"]
|
||||||
[ext_resource type="Texture2D" uid="uid://bo4q2rvn056p3" path="res://model/PatrickIdle1.png" id="2_w2lj6"]
|
[ext_resource type="Texture2D" uid="uid://bo4q2rvn056p3" path="res://model/PatrickIdle1.png" id="2_w2lj6"]
|
||||||
@@ -10,7 +10,6 @@
|
|||||||
[ext_resource type="Texture2D" uid="uid://b5mfnew4kh6ht" path="res://model/PatrickLeft1.png" id="5_vnnjt"]
|
[ext_resource type="Texture2D" uid="uid://b5mfnew4kh6ht" path="res://model/PatrickLeft1.png" id="5_vnnjt"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dyi5a1hlwio71" path="res://model/Glitch4.png" id="6_73f32"]
|
[ext_resource type="Texture2D" uid="uid://dyi5a1hlwio71" path="res://model/Glitch4.png" id="6_73f32"]
|
||||||
[ext_resource type="Texture2D" uid="uid://bu5nnr2x4co38" path="res://model/PatrickLeft2.png" id="6_jii6b"]
|
[ext_resource type="Texture2D" uid="uid://bu5nnr2x4co38" path="res://model/PatrickLeft2.png" id="6_jii6b"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cru3yl7laeiem" path="res://scene/principal.tscn" id="6_plp4a"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://doavv8drnetm" path="res://model/PatrickRight1.png" id="7_xptin"]
|
[ext_resource type="Texture2D" uid="uid://doavv8drnetm" path="res://model/PatrickRight1.png" id="7_xptin"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dbey2oeyhxsq8" path="res://model/PatrickRight2.png" id="8_m32jm"]
|
[ext_resource type="Texture2D" uid="uid://dbey2oeyhxsq8" path="res://model/PatrickRight2.png" id="8_m32jm"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dxepey1fkkhhv" path="res://model/DiabeteMeter1.png" id="9_0ohl3"]
|
[ext_resource type="Texture2D" uid="uid://dxepey1fkkhhv" path="res://model/DiabeteMeter1.png" id="9_0ohl3"]
|
||||||
@@ -399,7 +398,7 @@ limit_smoothed = true
|
|||||||
position_smoothing_enabled = true
|
position_smoothing_enabled = true
|
||||||
rotation_smoothing_speed = 7.0
|
rotation_smoothing_speed = 7.0
|
||||||
|
|
||||||
[node name="menu" parent="Camera2D" node_paths=PackedStringArray("anim") instance=ExtResource("3_6uvd0")]
|
[node name="menu" parent="Camera2D" node_paths=PackedStringArray("anim", "player") instance=ExtResource("3_6uvd0")]
|
||||||
visible = false
|
visible = false
|
||||||
offset_left = -47.0
|
offset_left = -47.0
|
||||||
offset_top = -60.0
|
offset_top = -60.0
|
||||||
@@ -407,7 +406,7 @@ offset_right = -47.0
|
|||||||
offset_bottom = -60.0
|
offset_bottom = -60.0
|
||||||
scale = Vector2(0.334, 0.334)
|
scale = Vector2(0.334, 0.334)
|
||||||
anim = NodePath("../../anim")
|
anim = NodePath("../../anim")
|
||||||
principal = ExtResource("6_plp4a")
|
player = NodePath("../..")
|
||||||
|
|
||||||
[node name="door_view" parent="Camera2D" instance=ExtResource("4_0vwed")]
|
[node name="door_view" parent="Camera2D" instance=ExtResource("4_0vwed")]
|
||||||
visible = false
|
visible = false
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
[gd_scene load_steps=9 format=3 uid="uid://cru3yl7laeiem"]
|
[gd_scene load_steps=8 format=3 uid="uid://cru3yl7laeiem"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://mr6hi8icwyle" path="res://model/Trick or treatBG.png" id="1_4oira"]
|
[ext_resource type="Texture2D" uid="uid://mr6hi8icwyle" path="res://model/Trick or treatBG.png" id="1_4oira"]
|
||||||
[ext_resource type="Script" path="res://script/Principal.cs" id="1_5hpqm"]
|
[ext_resource type="Script" path="res://script/Principal.cs" id="1_5hpqm"]
|
||||||
[ext_resource type="Theme" uid="uid://depo4fa5p8k8m" path="res://themes/button.tres" id="2_ab0tu"]
|
[ext_resource type="Theme" uid="uid://depo4fa5p8k8m" path="res://themes/button.tres" id="2_ab0tu"]
|
||||||
[ext_resource type="PackedScene" uid="uid://1tfopbwug3ht" path="res://scene/city.tscn" id="2_qp7s0"]
|
|
||||||
[ext_resource type="StyleBox" uid="uid://cl1mx7tnohwg6" path="res://themes/back_principal.tres" id="5_tyto3"]
|
[ext_resource type="StyleBox" uid="uid://cl1mx7tnohwg6" path="res://themes/back_principal.tres" id="5_tyto3"]
|
||||||
[ext_resource type="Texture2D" uid="uid://cf12hst5y4gfr" path="res://model/Credit.png" id="6_px85q"]
|
[ext_resource type="Texture2D" uid="uid://cf12hst5y4gfr" path="res://model/Credit.png" id="6_px85q"]
|
||||||
|
|
||||||
@@ -23,7 +22,6 @@ grow_vertical = 2
|
|||||||
script = ExtResource("1_5hpqm")
|
script = ExtResource("1_5hpqm")
|
||||||
sub = NodePath("sub")
|
sub = NodePath("sub")
|
||||||
credit = NodePath("credit")
|
credit = NodePath("credit")
|
||||||
play = ExtResource("2_qp7s0")
|
|
||||||
|
|
||||||
[node name="TrickOrTreatBg" type="Sprite2D" parent="."]
|
[node name="TrickOrTreatBg" type="Sprite2D" parent="."]
|
||||||
texture = ExtResource("1_4oira")
|
texture = ExtResource("1_4oira")
|
||||||
|
|||||||
6
scene/scene_manager.tscn
Normal file
6
scene/scene_manager.tscn
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://chc2do7pc6ews"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://script/SceneManager.cs" id="1_mayof"]
|
||||||
|
|
||||||
|
[node name="SceneManager" type="Node"]
|
||||||
|
script = ExtResource("1_mayof")
|
||||||
@@ -6,10 +6,13 @@ public partial class Menu : Control
|
|||||||
[Export] AnimationPlayer anim;
|
[Export] AnimationPlayer anim;
|
||||||
[Export] Panel pause;
|
[Export] Panel pause;
|
||||||
[Export] Panel trick;
|
[Export] Panel trick;
|
||||||
[Export] PackedScene principal;
|
[Export] CharacterBody2D player;
|
||||||
|
Node parent;
|
||||||
|
|
||||||
// Called when the node enters the scene tree for the first time.
|
// Called when the node enters the scene tree for the first time.
|
||||||
public override void _Ready()
|
public override void _Ready()
|
||||||
{
|
{
|
||||||
|
parent = player.GetParent().GetParent();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called every frame. 'delta' is the elapsed time since the previous frame.
|
// Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
@@ -32,7 +35,10 @@ public partial class Menu : Control
|
|||||||
|
|
||||||
public void ExitDown()
|
public void ExitDown()
|
||||||
{
|
{
|
||||||
GetTree().ChangeSceneToPacked(principal);
|
GetTree().Paused = false;
|
||||||
|
parent.Call("ToPrincipalFunc");
|
||||||
|
//EmitSignal("ToPrincipalEventHandler");
|
||||||
|
//GetTree().ChangeSceneToPacked(principal);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Res()
|
public void Res()
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ public partial class Player : CharacterBody2D
|
|||||||
[Export] TextureProgressBar bar;
|
[Export] TextureProgressBar bar;
|
||||||
[ExportGroup("controls")]
|
[ExportGroup("controls")]
|
||||||
[Export] Control menu;
|
[Export] Control menu;
|
||||||
[Export] PackedScene principal;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,12 +5,14 @@ public partial class Principal : Control
|
|||||||
{
|
{
|
||||||
[Export] Panel sub;
|
[Export] Panel sub;
|
||||||
[Export] Panel credit;
|
[Export] Panel credit;
|
||||||
[Export] PackedScene play;
|
|
||||||
|
Node parent;
|
||||||
|
|
||||||
// Called when the node enters the scene tree for the first time.
|
// Called when the node enters the scene tree for the first time.
|
||||||
public override void _Ready()
|
public override void _Ready()
|
||||||
{
|
{
|
||||||
|
parent = GetParent();
|
||||||
|
sub.Visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called every frame. 'delta' is the elapsed time since the previous frame.
|
// Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
@@ -20,6 +22,7 @@ public partial class Principal : Control
|
|||||||
|
|
||||||
public void EnterPressed()
|
public void EnterPressed()
|
||||||
{
|
{
|
||||||
|
GD.Print("wefwef");
|
||||||
sub.Visible = true;
|
sub.Visible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,7 +40,9 @@ public partial class Principal : Control
|
|||||||
|
|
||||||
public void PlayPressed()
|
public void PlayPressed()
|
||||||
{
|
{
|
||||||
GetTree().ChangeSceneToPacked(play);
|
parent.Call("ToCityFunc");
|
||||||
|
//EmitSignal("ToCityEventHandler");
|
||||||
|
//GetTree().ChangeSceneToPacked(play);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ExitGlobPressed()
|
public void ExitGlobPressed()
|
||||||
|
|||||||
43
script/SceneManager.cs
Normal file
43
script/SceneManager.cs
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
using Godot;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
public partial class SceneManager : Node
|
||||||
|
{
|
||||||
|
PackedScene principal ;
|
||||||
|
PackedScene city;
|
||||||
|
Node actuel;
|
||||||
|
|
||||||
|
|
||||||
|
[Signal] public delegate void ToPrincipalEventHandler();
|
||||||
|
[Signal] public delegate void ToCityEventHandler();
|
||||||
|
// Called when the node enters the scene tree for the first time.
|
||||||
|
public override void _Ready()
|
||||||
|
{
|
||||||
|
Callable PrincipalCallable = new Callable(this, MethodName.ToPrincipalFunc);
|
||||||
|
Connect(SignalName.ToPrincipal, PrincipalCallable);
|
||||||
|
|
||||||
|
Callable CityCallable = new Callable(this, MethodName.ToCityFunc);
|
||||||
|
Connect(SignalName.ToCity, CityCallable);
|
||||||
|
|
||||||
|
|
||||||
|
principal = (PackedScene)ResourceLoader.Load("res://scene/principal.tscn");
|
||||||
|
city = (PackedScene)ResourceLoader.Load("res://scene/city.tscn");
|
||||||
|
actuel = principal.Instantiate();
|
||||||
|
AddChild(actuel);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ToPrincipalFunc()
|
||||||
|
{
|
||||||
|
actuel.QueueFree();
|
||||||
|
actuel = principal.Instantiate();
|
||||||
|
AddChild(actuel);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ToCityFunc()
|
||||||
|
{
|
||||||
|
actuel.QueueFree();
|
||||||
|
actuel = city.Instantiate();
|
||||||
|
AddChild(actuel);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user