menu et +
This commit is contained in:
@@ -4,6 +4,9 @@ using System;
|
||||
public partial class Menu : Control
|
||||
{
|
||||
[Export] AnimationPlayer anim;
|
||||
[Export] Panel pause;
|
||||
[Export] Panel trick;
|
||||
[Export] PackedScene principal;
|
||||
// Called when the node enters the scene tree for the first time.
|
||||
public override void _Ready()
|
||||
{
|
||||
@@ -23,16 +26,23 @@ public partial class Menu : Control
|
||||
|
||||
public void OptionDown()
|
||||
{
|
||||
|
||||
pause.Visible = false;
|
||||
trick.Visible = true;
|
||||
}
|
||||
|
||||
public void ExitDown()
|
||||
{
|
||||
GetTree().Quit();
|
||||
GetTree().ChangeSceneToPacked(principal);
|
||||
}
|
||||
|
||||
public void Res()
|
||||
{
|
||||
GetTree().Paused = false;
|
||||
}
|
||||
|
||||
public void ExitTrick()
|
||||
{
|
||||
pause.Visible = true;
|
||||
trick.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ public partial class Player : CharacterBody2D
|
||||
[Export] TextureProgressBar bar;
|
||||
[ExportGroup("controls")]
|
||||
[Export] Control menu;
|
||||
[Export] PackedScene principal;
|
||||
|
||||
|
||||
|
||||
@@ -31,7 +32,7 @@ public partial class Player : CharacterBody2D
|
||||
}
|
||||
else if (sugar >= 100)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,8 +4,9 @@ using System;
|
||||
public partial class Principal : Control
|
||||
{
|
||||
[Export] Panel sub;
|
||||
[Export] Panel credit;
|
||||
[Export] PackedScene play;
|
||||
[Export] PackedScene credit;
|
||||
|
||||
// Called when the node enters the scene tree for the first time.
|
||||
public override void _Ready()
|
||||
{
|
||||
@@ -21,4 +22,26 @@ public partial class Principal : Control
|
||||
{
|
||||
sub.Visible = true;
|
||||
}
|
||||
|
||||
public void creditEnter()
|
||||
{
|
||||
credit.Visible = true;
|
||||
sub.Visible = false;
|
||||
}
|
||||
|
||||
public void CreditExit()
|
||||
{
|
||||
credit.Visible = false;
|
||||
sub.Visible = true;
|
||||
}
|
||||
|
||||
public void PlayPressed()
|
||||
{
|
||||
GetTree().ChangeSceneToPacked(play);
|
||||
}
|
||||
|
||||
public void ExitGlobPressed()
|
||||
{
|
||||
GetTree().Quit();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user