better menu
This commit is contained in:
@@ -22,14 +22,25 @@ public class MenuBackground : Node2D
|
||||
int addCount = nParticles - currentCount;
|
||||
for (int i = 0; i < addCount; i++)
|
||||
{
|
||||
|
||||
CreateParticle();
|
||||
}
|
||||
}
|
||||
// TODO pick random particles to delete
|
||||
}
|
||||
|
||||
//TODO add private method to add particles
|
||||
|
||||
public override void _Process(float delta)
|
||||
|
||||
private void CreateParticle()
|
||||
{
|
||||
var particlePackedScene = GD.Load<PackedScene>("res://ParticleSimulation/ParticleNode.tscn");
|
||||
var particleNode = particlePackedScene.Instance<ParticleNode>();
|
||||
_particleNodes.AddChild(particleNode);
|
||||
var screenSize = GetViewportRect().Size;
|
||||
var position = new Vector2(
|
||||
(float) GD.RandRange(0, screenSize.x),
|
||||
(float) GD.RandRange(0, screenSize.y));
|
||||
particleNode.Position = position;
|
||||
}
|
||||
|
||||
public override void _Process(float delta)
|
||||
{
|
||||
//var particleNodesArray = _particleNodes.GetChildren();
|
||||
//foreach (ParticleNode particle in particleNodesArray)
|
||||
|
||||
Reference in New Issue
Block a user