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

47 lines
1.2 KiB
C#

using Godot;
using System;
using System.Collections.Generic;
using System.Linq;
public partial class ComputerManager : Manager
{
public int _id = 1;
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()
{
Ball newBall;
BallSprite newBallSprite;
for (int i = 8; i <= 15; i++)
{
newBall = _ballScene.Instantiate<Ball>();
newBall.SetSprite("res://art/ball_" + i + ".png");
newBall._rackPosition = _initialRackPositions[i - 8];
newBall._ownerId = _id;
_balls.Add(newBall);
newBallSprite = _ballSpriteScene.Instantiate<BallSprite>();
newBallSprite.SetSprite("res://art/ball_" + i + ".png");
newBallSprite._rackPosition = _initialRackPositions[i - 8];
newBallSprite._ownerId = _id;
_ballSprites.Add(newBallSprite);
}
}
public override void Start()
{
}
}