Fixed links
This commit is contained in:
parent
bdf02db5c8
commit
eb408a62bb
18 changed files with 40 additions and 42 deletions
|
|
@ -5,7 +5,7 @@ public partial class LeftBoundaryMarker : Marker2D
|
|||
{
|
||||
public override void _Ready()
|
||||
{
|
||||
Utility.LeftFieldBoundary = (Vector2I)GlobalPosition;
|
||||
FieldParams.LeftFieldBoundary = (Vector2I)GlobalPosition;
|
||||
QueueFree();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,10 +50,10 @@ public partial class PlantField : Node2D
|
|||
_plantSetter.GlobalPosition = mouse_pos;
|
||||
|
||||
// Getting position in grid coordinates
|
||||
var expected_pos = (_plantSetter.GlobalPosition / Utility.Tile).Ceil() * Utility.Tile - new Vector2(20, 14);
|
||||
var expected_pos = (_plantSetter.GlobalPosition / FieldParams.Tile).Ceil() * FieldParams.Tile - new Vector2(20, 14);
|
||||
|
||||
// Checking for boundaries
|
||||
bool inBoundary = expected_pos.X > Utility.LeftFieldBoundary.X && expected_pos.X < Utility.RightFieldBoundary.X && expected_pos.Y > Utility.LeftFieldBoundary.Y && expected_pos.Y < Utility.RightFieldBoundary.Y;
|
||||
bool inBoundary = expected_pos.X > FieldParams.LeftFieldBoundary.X && expected_pos.X < FieldParams.RightFieldBoundary.X && expected_pos.Y > FieldParams.LeftFieldBoundary.Y && expected_pos.Y < FieldParams.RightFieldBoundary.Y;
|
||||
|
||||
|
||||
bool canPlace = _resource != null
|
||||
|
|
@ -92,14 +92,14 @@ public partial class PlantField : Node2D
|
|||
{
|
||||
var plant = _resource.Scene.Instantiate<RuntimePlantData>();
|
||||
PoolContainer.Instance.Plants.AddChild(plant);
|
||||
plant.GlobalPosition = (_plantSetter.GlobalPosition / Utility.Tile).Ceil() * Utility.Tile - new Vector2(20, 14);
|
||||
plant.GlobalPosition = (_plantSetter.GlobalPosition / FieldParams.Tile).Ceil() * FieldParams.Tile - new Vector2(20, 14);
|
||||
plant.Resource = (PlantResource)_resource;
|
||||
|
||||
PoolContainer.Instance.EntityField[_resource.Layer].Add(plant.GlobalPosition, plant);
|
||||
|
||||
RuntimeLevelData.Instance.SpendSun(_resource.Cost);
|
||||
|
||||
PoolContainer.Instance.SpawnParticles(particles, plant.GlobalPosition + Vector2.Down * Utility.TileHeight/2.0f);
|
||||
PoolContainer.Instance.SpawnParticles(particles, plant.GlobalPosition + Vector2.Down * FieldParams.TileHeight/2.0f);
|
||||
|
||||
player.Play();
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ public partial class RightBoundaryMarker : Marker2D
|
|||
{
|
||||
public override void _Ready()
|
||||
{
|
||||
Utility.RightFieldBoundary = (Vector2I)GlobalPosition;
|
||||
FieldParams.RightFieldBoundary = (Vector2I)GlobalPosition;
|
||||
QueueFree();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,16 +14,16 @@ public partial class SunSpawner : Node
|
|||
|
||||
public void Spawn()
|
||||
{
|
||||
float x = GD.Randf()*9*Utility.TileWidth;
|
||||
float x = GD.Randf()*9*FieldParams.TileWidth;
|
||||
uint y = GD.Randi() % 5;
|
||||
|
||||
var sun = SunScene.Instantiate<Sun>();
|
||||
PoolContainer.Instance.Projectiles.AddChild(sun);
|
||||
|
||||
sun.GlobalPosition = new Vector2(Utility.LeftFieldBoundary.X + x, -90);
|
||||
sun.GlobalPosition = new Vector2(FieldParams.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);
|
||||
moveTween.TweenProperty(sun,"global_position", new Vector2(FieldParams.LeftFieldBoundary.X + x,
|
||||
FieldParams.LeftFieldBoundary.Y + FieldParams.TileHeight * y + FieldParams.TileHeight/2.0f),9-y);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public partial class RowSpawner : Node2D
|
|||
RuntimeZombieData zombie = resource.Scene.Instantiate<RuntimeZombieData>();
|
||||
PoolContainer.Instance.Zombies.AddChild(zombie);
|
||||
|
||||
zombie.GlobalPosition = new Vector2(GlobalPosition.X, Utility.LeftFieldBoundary.Y + lane * Utility.TileHeight);
|
||||
zombie.GlobalPosition = new Vector2(GlobalPosition.X, FieldParams.LeftFieldBoundary.Y + lane * FieldParams.TileHeight);
|
||||
runner.AddZombie(zombie);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public partial class ZombieSequencer : Node2D
|
|||
RuntimeZombieData zombie = GameRegistry.GetZombieByName(id).Scene.Instantiate<RuntimeZombieData>();
|
||||
PoolContainer.Instance.Zombies.AddChild(zombie);
|
||||
|
||||
zombie.GlobalPosition = new Vector2(GlobalPosition.X, Utility.RightFieldBoundary.Y - (lane - 1) * Utility.TileHeight);
|
||||
zombie.GlobalPosition = new Vector2(GlobalPosition.X, FieldParams.RightFieldBoundary.Y - (lane - 1) * FieldParams.TileHeight);
|
||||
}
|
||||
|
||||
public void Add(string id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue