pause now is not mandatory
This commit is contained in:
parent
f65cb11474
commit
5d4ae478dc
7 changed files with 31 additions and 8 deletions
|
|
@ -8,13 +8,12 @@ public partial class SunSpawner : Node
|
|||
public int MinSun = 25;
|
||||
[Export]
|
||||
public int MaxSun = 25;
|
||||
|
||||
[Export]
|
||||
private PackedScene SunScene;
|
||||
|
||||
public void Spawn()
|
||||
{
|
||||
float x = GD.Randf()*9*FieldParams.TileWidth;
|
||||
float x = GD.Randf() * 9 * FieldParams.TileWidth;
|
||||
uint y = GD.Randi() % 5;
|
||||
|
||||
var sun = SunScene.Instantiate<Sun>();
|
||||
|
|
@ -23,7 +22,7 @@ public partial class SunSpawner : Node
|
|||
sun.GlobalPosition = new Vector2(FieldParams.LeftFieldBoundary.X + x, -90);
|
||||
|
||||
var moveTween = CreateTween();
|
||||
moveTween.TweenProperty(sun,"global_position", new Vector2(FieldParams.LeftFieldBoundary.X + x,
|
||||
FieldParams.LeftFieldBoundary.Y + FieldParams.TileHeight * y + FieldParams.TileHeight/2.0f),9-y);
|
||||
moveTween.TweenProperty(sun, "global_position", new Vector2(FieldParams.LeftFieldBoundary.X + x,
|
||||
FieldParams.LeftFieldBoundary.Y + FieldParams.TileHeight * y + FieldParams.TileHeight / 2.0f), 9 - y);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue