Files
hotdesking/Gameplay/ComputerManager.cs
2025-08-04 02:42:51 -04:00

49 lines
1.2 KiB
C#

using Godot;
using System;
using System.Collections.Generic;
using System.Linq;
public partial class ComputerManager : Manager
{
public List<Vector2I> _initialRackPositions =
[
new Vector2I(2, 3),
new Vector2I(2, 1),
new Vector2I(5, 1),
new Vector2I(1, 2),
new Vector2I(3, 2),
new Vector2I(3, 3),
new Vector2I(1, 4),
new Vector2I(1, 5)
];
public override void _Ready()
{
base._Ready();
Ball newBall;
BallSprite newBallSprite;
for (int i = 0; i < 8; i++)
{
newBall = _ballScene.Instantiate<Ball>();
newBall.SetSprite("res://art/ball_" + (i+8) + ".png");
newBall._rackPosition = _initialRackPositions[i];
newBall._owner = this;
_balls.Add(newBall);
newBallSprite = _ballSpriteScene.Instantiate<BallSprite>();
newBallSprite.SetSprite(newBall._imagePath);
newBallSprite._rackPosition = _initialRackPositions[i];
newBallSprite._owner = this;
_ballSprites.Add(newBallSprite);
}
}
public override void Start()
{
}
}