Sun, Shovel, Fastforward, GUI Improvements
This commit is contained in:
parent
26c3aeb7e9
commit
63935d5978
28 changed files with 546 additions and 45 deletions
28
scripts/components/level/SunSpawner.cs
Normal file
28
scripts/components/level/SunSpawner.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class SunSpawner : Node
|
||||
{
|
||||
[Export]
|
||||
public int MinSun = 25;
|
||||
[Export]
|
||||
public int MaxSun = 25;
|
||||
|
||||
[Export]
|
||||
private PackedScene SunScene;
|
||||
|
||||
public void Spawn()
|
||||
{
|
||||
float x = GD.Randf()*9*Utility.TileWidth;
|
||||
uint y = GD.Randi() % 5;
|
||||
|
||||
var sun = SunScene.Instantiate<Sun>();
|
||||
LevelController.Instance.Pools.Projectiles.AddChild(sun);
|
||||
|
||||
sun.GlobalPosition = new Vector2(Utility.LeftFieldBoundary.X + x, -90);
|
||||
|
||||
var moveTween = CreateTween();
|
||||
moveTween.TweenProperty(sun,"global_position", new Vector2(Utility.LeftFieldBoundary.X + x,
|
||||
Utility.LeftFieldBoundary.Y + Utility.TileHeight * y + Utility.TileHeight/2.0f),9-y);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue