Ninja Kirby
Ninja Kirby
CC#
Created by Ninja Kirby on 3/13/2024 in #help
✅ having stupidity. why can THE ROOOOOOOOOOOOOOOOK!!! move through the first pawn?
adding one to position.x / ychanged it
63 replies
CC#
Created by Ninja Kirby on 3/13/2024 in #help
✅ having stupidity. why can THE ROOOOOOOOOOOOOOOOK!!! move through the first pawn?
(news flash - it worked!)
63 replies
CC#
Created by Ninja Kirby on 3/13/2024 in #help
✅ having stupidity. why can THE ROOOOOOOOOOOOOOOOK!!! move through the first pawn?
time to do random shit and hope it works edition
63 replies
CC#
Created by Ninja Kirby on 3/13/2024 in #help
✅ having stupidity. why can THE ROOOOOOOOOOOOOOOOK!!! move through the first pawn?
// check left of rook
for (int x = 1; x < Position.x; x++)
{
Position dir = new Position(Position.x - x, Position.y);

if (Board.Pieces[dir] is not null)
break;

validMoves.Add(dir);
}

// check right of rook
for (int x = 1; x < Board.Width - Position.x; x++)
{
Position dir = new Position(Position.x + x, Position.y);

if (Board.Pieces[dir] is not null)
break;

validMoves.Add(dir);
}

// check top of rook
for (int y = 1; y < Position.y; y++)
{
Position dir = new Position(Position.x, Position.y - y);

if (Board.Pieces[dir] is not null)
break;

validMoves.Add(dir);
}

// check top of rook
for (int y = 1; y < Board.Height - Position.y; y++)
{
Position dir = new Position(Position.x, Position.y + y);

if (Board.Pieces[dir] is not null)
break;

validMoves.Add(dir);
}
// check left of rook
for (int x = 1; x < Position.x; x++)
{
Position dir = new Position(Position.x - x, Position.y);

if (Board.Pieces[dir] is not null)
break;

validMoves.Add(dir);
}

// check right of rook
for (int x = 1; x < Board.Width - Position.x; x++)
{
Position dir = new Position(Position.x + x, Position.y);

if (Board.Pieces[dir] is not null)
break;

validMoves.Add(dir);
}

// check top of rook
for (int y = 1; y < Position.y; y++)
{
Position dir = new Position(Position.x, Position.y - y);

if (Board.Pieces[dir] is not null)
break;

validMoves.Add(dir);
}

// check top of rook
for (int y = 1; y < Board.Height - Position.y; y++)
{
Position dir = new Position(Position.x, Position.y + y);

if (Board.Pieces[dir] is not null)
break;

validMoves.Add(dir);
}
63 replies
CC#
Created by Ninja Kirby on 3/13/2024 in #help
✅ having stupidity. why can THE ROOOOOOOOOOOOOOOOK!!! move through the first pawn?
its just that but with 1 as the initial value and I added the y axis as well
63 replies
CC#
Created by Ninja Kirby on 3/13/2024 in #help
✅ having stupidity. why can THE ROOOOOOOOOOOOOOOOK!!! move through the first pawn?
No description
63 replies
CC#
Created by Ninja Kirby on 3/13/2024 in #help
✅ having stupidity. why can THE ROOOOOOOOOOOOOOOOK!!! move through the first pawn?
💀
63 replies
CC#
Created by Ninja Kirby on 3/13/2024 in #help
✅ having stupidity. why can THE ROOOOOOOOOOOOOOOOK!!! move through the first pawn?
Position
63 replies
CC#
Created by Ninja Kirby on 3/13/2024 in #help
✅ having stupidity. why can THE ROOOOOOOOOOOOOOOOK!!! move through the first pawn?
is just
63 replies
CC#
Created by Ninja Kirby on 3/13/2024 in #help
✅ having stupidity. why can THE ROOOOOOOOOOOOOOOOK!!! move through the first pawn?
because new Position(Position.x + x, Position.y); where x = 0
63 replies
CC#
Created by Ninja Kirby on 3/13/2024 in #help
✅ having stupidity. why can THE ROOOOOOOOOOOOOOOOK!!! move through the first pawn?
i think tis catching myself
63 replies
CC#
Created by Ninja Kirby on 3/13/2024 in #help
✅ having stupidity. why can THE ROOOOOOOOOOOOOOOOK!!! move through the first pawn?
nothing
63 replies
CC#
Created by Ninja Kirby on 3/13/2024 in #help
✅ having stupidity. why can THE ROOOOOOOOOOOOOOOOK!!! move through the first pawn?
// check left of rook
for (int x = 0; x < Position.x; x++)
{
Position dir = new Position(Position.x - x, Position.y);

if (Board.Pieces[dir] != null)
break;

validMoves.Add(dir);
}

// check right of rook
for (int x = 0; x < Board.Width - Position.x; x++)
{
Position dir = new Position(Position.x + x, Position.y);

if (Board.Pieces[dir] != null)
break;

validMoves.Add(dir);
}
// check left of rook
for (int x = 0; x < Position.x; x++)
{
Position dir = new Position(Position.x - x, Position.y);

if (Board.Pieces[dir] != null)
break;

validMoves.Add(dir);
}

// check right of rook
for (int x = 0; x < Board.Width - Position.x; x++)
{
Position dir = new Position(Position.x + x, Position.y);

if (Board.Pieces[dir] != null)
break;

validMoves.Add(dir);
}
like that?
63 replies
CC#
Created by Ninja Kirby on 3/13/2024 in #help
✅ having stupidity. why can THE ROOOOOOOOOOOOOOOOK!!! move through the first pawn?
yeaah
63 replies
CC#
Created by Ninja Kirby on 3/13/2024 in #help
✅ having stupidity. why can THE ROOOOOOOOOOOOOOOOK!!! move through the first pawn?
yeah
63 replies
CC#
Created by Ninja Kirby on 3/13/2024 in #help
✅ having stupidity. why can THE ROOOOOOOOOOOOOOOOK!!! move through the first pawn?
wouldnt distance from left side just be position.x
63 replies
CC#
Created by Ninja Kirby on 3/13/2024 in #help
✅ having stupidity. why can THE ROOOOOOOOOOOOOOOOK!!! move through the first pawn?
how would I get distance from left side board
63 replies
CC#
Created by Ninja Kirby on 3/13/2024 in #help
✅ having stupidity. why can THE ROOOOOOOOOOOOOOOOK!!! move through the first pawn?
no wait
63 replies
CC#
Created by Ninja Kirby on 3/13/2024 in #help
✅ having stupidity. why can THE ROOOOOOOOOOOOOOOOK!!! move through the first pawn?
silly me
63 replies
CC#
Created by Ninja Kirby on 3/13/2024 in #help
✅ having stupidity. why can THE ROOOOOOOOOOOOOOOOK!!! move through the first pawn?
not > 0
63 replies