Написать игру на C#
18 USDНужна игра в китайские шашки для сдачи преподу. Максимальнопросто. Есть наработки. Но времени нет
public class BoardSpawn : MonoBehaviour
{
[SerializeField]
GameObject tiles, pawn;
[SerializeField]
float offset;
//Skapar en jagged array av spelobjekt.
GameObject[][] board = new GameObject[17][];
TileScript[][] virtualBoard = new TileScript[17][];
int[] upperOffset = new int[] { 1, 1, 1, 5, 0, 0, 0, 0, 1, 1, 1, 1, -4, 0, 0, 0 };
int[] lowerOffset = new int[] { 0, 0, 0, -4, 1, 1, 1, 1, 0, 0, 0, 0, 5, 1, 1, 1 };
//Längden på raden.
int[] rowLengths = new int[] { 1, 2, 3, 4, 13, 12, 11, 10, 9, 10, 11, 12, 13, 4, 3, 2, 1 };
void Start()
{
SpawnThisBoard();
SetNeighbours();
}
// spawning the board with for in for loop
void SpawnThisBoard()
{// loops through the row
for (int i = 0; i < board.Length; i++)
{
board[i] = new GameObject[rowLengths[i]];
virtualBoard[i] = new TileScript[rowLengths[i]];
//loops through the column
for (int j = 0; j < board[i].Length; j++)
{
// Creates a tile for each index position for the current row
GameObject tile = Instantiate(tiles, new Vector3((-(rowLengths[i] - 1) + (offset * j)), 0f, offset * (8 - i)), Quaternion.identity);
virtualBoard[i][j] = tile.GetComponent<TileScript>();
virtualBoard[i][j].AssignIndex(j, i);
// Just a switch to give certian positions a color
switch (i)
{
case 0:
case 1:
case 2:
case 3:
virtualBoard[i][j].SetColor(yellow);
break;
case 4:
case 5:
case 6:
case 7:
if (j < board[i].Length - 9)
{
virtualBoard[i][j].SetColor(blue);
}
else if (j > 8)
{
virtualBoard[i][j].SetColor(red);
}
break;
case 8:
break;
case 9:
case 10:
case 11:
case 12:
if (j < board[i].Length - 9)
{
virtualBoard[i][j].SetColor(green);
}
else if (j > 8)
{
virtualBoard[i][j].SetColor(black);
}
break;
case 13:
case 14:
case 15:
case 16:
virtualBoard[i][j].SetColor(white);
break;
default:
break;
}
}
}
}
// gives position and direction to each tile
void SetNeighbours()
{
int test = 0;
for (int i = 0; i < virtualBoard.Length; i++)
{
int min = 0, max = 0, rowOffset = 0;
switch (i)
{
case 1:
case 2:
case 3:
max = virtualBoard[i].Length - 1;
break;
}
for (int j = 0; j < virtualBoard[i].Length; j++)
{
//If its not the tile on the top corner then we have a neighbour above the tile
if (i > 0)
{
if (j < max)
{
virtualBoard[i][j].CreateNeighbour(virtualBoard[i - 1][j + rowOffset], Direction.UpperLeft);
}
if (j >= min && j + rowOffset < virtualBoard[i - 1].Length)
{
virtualBoard[i][j].CreateNeighbour(virtualBoard[i - 1][j + rowOffset], Direction.UpperRight);
}
if (j - lowerOffset[i] == 0)
{
virtualBoard[i][j].CreateNeighbour(virtualBoard[i - 1][(j + lowerOffset[i])], Direction.UpperLeft);
}
if (j - lowerOffset[i] == 0)
{
virtualBoard[i][j].CreateNeighbour(virtualBoard[i - 1][(j - lowerOffset[i])], Direction.UpperRight);
}
}
//if its not the last tile on the bottom corner then the tile has a neighbour below
if (i < virtualBoard.Length - 1)
{
if (j - lowerOffset[i] == 1)
{
virtualBoard[i][j].CreateNeighbour(virtualBoard[i + 1][j - (upperOffset[i] - 1)], Direction.LowerLeft);
}
if (j - lowerOffset[i] == 0)
{
virtualBoard[i][j].CreateNeighbour(virtualBoard[i + 1][j - (upperOffset[i] - 1)], Direction.LowerRight);
}
}
//if its not the last tile on the left side, the tile has a neighbour on its left side.
if (j > 0)
{
virtualBoard[i][j].CreateNeighbour(virtualBoard[i][j - 1], Direction.Left);
}
//if its not the last tile on the right ride, the tile has a neighbour on its right side.
if (j < virtualBoard[i].Length - 1)
{
virtualBoard[i][j].CreateNeighbour(virtualBoard[i][j + 1], Direction.Right);
}
}
}
}
}
Client's review of cooperation with Yury Pahomau
Написать игру на C#Beautiful and rapidly. I will contact more.
Freelancer's review of cooperation with Makar Fadeyev
Написать игру на C#Everything is great, thank you for the opportunity to make money.
Current freelance projects in the category C#
Comparative analysis of the effectiveness of custom software (v2.2-field) and reference software (Meshtastic v2.x)
22 USD
Comparative analysis of the effectiveness of custom software (v2.2-field) and reference software (Meshtastic v2.x) on the identical hardware platform (ESP32 + SX1268, 2W) based on the criteria of range, throughput, link stability, and power consumption. Conduct tests with… C & C++, C# ∙ 7 days 9 hours back ∙ 2 proposals |
Creation of a plugin for integration with the POS system Syrve, C#Develop a plugin for the Syrve POS system (on-premise), which is installed on the establishment's server. The plugin must: (1) transmit data to our server in real-time — orders, table statuses, payments, receipts; (2) receive commands from Reservble — booking confirmations,… C#, Web Programming ∙ 10 days 6 hours back ∙ 14 proposals |