2021-12-26 14:58:58 -05:00
|
|
|
using Godot;
|
2022-01-17 23:52:42 -05:00
|
|
|
using System;
|
2021-12-26 14:58:58 -05:00
|
|
|
|
2022-01-17 23:52:42 -05:00
|
|
|
public class Main : Node
|
2021-12-26 14:58:58 -05:00
|
|
|
{
|
2021-12-27 14:58:33 -05:00
|
|
|
|
2022-01-25 12:02:24 -05:00
|
|
|
public void StartSimulation(int seed, int nParticles)
|
2021-12-27 16:10:07 -05:00
|
|
|
{
|
2022-01-18 12:01:37 -05:00
|
|
|
var particleSimulationPackedScene = GD.Load<PackedScene>("res://ParticleSimulation/ParticleSimulationScene.tscn");
|
2022-01-17 23:52:42 -05:00
|
|
|
var particleSimulationScene = particleSimulationPackedScene.Instance<ParticleSimulationScene>();
|
2022-01-25 12:02:24 -05:00
|
|
|
particleSimulationScene.Name = "Simulation";
|
2022-01-17 23:52:42 -05:00
|
|
|
AddChild(particleSimulationScene);
|
2022-01-25 12:02:24 -05:00
|
|
|
particleSimulationScene.Initialize(seed, nParticles);
|
2022-01-17 23:52:42 -05:00
|
|
|
GetNode<Control>("MainMenu").Hide();
|
|
|
|
//OS.WindowResizable = false;
|
2021-12-26 21:16:28 -05:00
|
|
|
}
|
2022-01-25 12:02:24 -05:00
|
|
|
|
|
|
|
public void ExitToMenu()
|
|
|
|
{
|
|
|
|
GetNode("Simulation").QueueFree();
|
|
|
|
GetNode<Control>("MainMenu").Show();
|
|
|
|
}
|
2022-01-17 23:52:42 -05:00
|
|
|
|
|
|
|
}
|