update
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -48,7 +48,7 @@ namespace Tic_Tac_Toe {
|
|||||||
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
|
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
|
||||||
Exit();
|
Exit();
|
||||||
|
|
||||||
System.Console.WriteLine("TEST KIIRAS");
|
|
||||||
|
|
||||||
// TODO: Add your update logic here
|
// TODO: Add your update logic here
|
||||||
if (playerWon == 0) {
|
if (playerWon == 0) {
|
||||||
@@ -60,12 +60,14 @@ namespace Tic_Tac_Toe {
|
|||||||
if (rectArray[i, j].Contains(new Point(mouse.X, mouse.Y)) && mouse.LeftButton == ButtonState.Pressed && CircleXPostion[i, j] == 0) {
|
if (rectArray[i, j].Contains(new Point(mouse.X, mouse.Y)) && mouse.LeftButton == ButtonState.Pressed && CircleXPostion[i, j] == 0) {
|
||||||
CircleXPostion[i, j] = 1; //eltároljuk a kör pozicióját
|
CircleXPostion[i, j] = 1; //eltároljuk a kör pozicióját
|
||||||
isCircleNext = false;
|
isCircleNext = false;
|
||||||
|
printGameStateArray();
|
||||||
//System.Threading.Thread.Sleep(250);
|
//System.Threading.Thread.Sleep(250);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (rectArray[i, j].Contains(new Point(mouse.X, mouse.Y)) && mouse.LeftButton == ButtonState.Pressed && CircleXPostion[i, j] == 0) {
|
if (rectArray[i, j].Contains(new Point(mouse.X, mouse.Y)) && mouse.LeftButton == ButtonState.Pressed && CircleXPostion[i, j] == 0) {
|
||||||
CircleXPostion[i, j] = 2; //eltaroljuk az x poziciojat
|
CircleXPostion[i, j] = 2; //eltaroljuk az x poziciojat
|
||||||
isCircleNext = true;
|
isCircleNext = true;
|
||||||
|
printGameStateArray();
|
||||||
//System.Threading.Thread.Sleep(250);
|
//System.Threading.Thread.Sleep(250);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -149,6 +151,16 @@ namespace Tic_Tac_Toe {
|
|||||||
_spriteBatch.DrawRectangle(rectArray[indexX, indexY], color, lineThickness, 0);
|
_spriteBatch.DrawRectangle(rectArray[indexX, indexY], color, lineThickness, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void printGameStateArray() {
|
||||||
|
for (int i = 0; i < CircleXPostion.GetLength(0); i++) {
|
||||||
|
for (int j = 0; j < CircleXPostion.GetLength(1); j++) {
|
||||||
|
System.Console.Write(CircleXPostion[i,j] + " | ");
|
||||||
|
}
|
||||||
|
System.Console.WriteLine();
|
||||||
|
}
|
||||||
|
System.Console.WriteLine("\n\n");
|
||||||
|
}
|
||||||
|
|
||||||
private void CheckGameCondition() {
|
private void CheckGameCondition() {
|
||||||
//vertical
|
//vertical
|
||||||
//circle
|
//circle
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<RollForward>Major</RollForward>
|
<RollForward>Major</RollForward>
|
||||||
<PublishReadyToRun>false</PublishReadyToRun>
|
<PublishReadyToRun>false</PublishReadyToRun>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user