Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rushi Board Game
#1
Quote:Hello all,

Rushi is a 2 player board game. The goal is to be the first player to get their pieces across the board to their opponent's home row. The Board is a 6X5 game board with each players having 7 pieces, 6 on the board and 1 in their hand. There are 3 different pieces: cross, x and single arrow piece. All pieces has arrows. The arrows point to other squares on the board.

A move consist of taking the piece in your hand and placing on the board at 1 of the squares that at least 1 arrow is poiting to. Then pick up 1 of the pieces that has an arrow pointing to the square you placed your piece. The piece you pick up goes in your hand. So a move consist of placing a piece and picking up a piece. If you have no playable moves or you can choose to swap the piece in your hand with another of your pieces on the board. However, you can not swap pieces 2 moves in a row.

To prevent players from keeping a piece on their back row, preventing their opponent from moving a piece there, all pieces must be moved off their back row within 100 moves. after 89 moves, if either player still has any pieces on their back row they will get a warning to get their pieces off the back row. So each player will have 5 moves each to clear their back row. If after 100 moves, 1 of the players still has a piece on the back row, the game is over and their opponent is delcaired the winner. If both players still have a piece left on their back row, the game ends in a draw.

The first player has the blue arrow piece and their oppnent has the green arrows. The back side of the pieces are blue and green accordingly. A back side of the current players piece is centered on the right side of the screen to indicate which player's turn it is. Beside the player's indicator piece on the right side of the screen, will appear a SWAP button that you can click if you wish to swap pieces. The button will then be selected and you will be prompt to choose piece on the board to swap with.

The game starts off with a single arrow piece in your hand. That piece can be placed on the board facing 4 different directions. So, when the game starts, 4 single arrow pieces are on the right side of the screen, beside the board next to your back row. use your mouse to select which piece rotation you want. Then that rotation will be selected with a cursor around it and placed centered. The cross and the X will automatically be selected and you just choose the square on the board to place it.

If more than 1 piece is pointing to the piece just placed, a cursor will surround those pieces. Click on the piece that you want to put in your hand. If only 1 piece pointed to that square, the piece will automatically placed in your hand and play continued to the next player.

As the pieces reach your opponents back row, they are flipped to the back side of the piece and locked there. if you can't play a piece then your turn is skipped and you will be prompted to press ENTER to continue to next player.

I have included a copy of the rules. Hope you enjoy playing.

Donald

   


.docx   RUSHI COMPLETE RULES.docx (Size: 190.1 KB / Downloads: 31)

Code: (Select All)
_Title "Rushi Desigbned by Danny Zondervanby 2016 - Programmed by Donal L. Foster Jr. 2017"

Screen _NewImage(1125, 735, 256)

_PaletteColor 1, _RGB32(244, 164, 96) ' Light Square
_PaletteColor 2, _RGB32(94, 38, 18) ' Dark Square
_PaletteColor 3, _RGB32(10, 124, 235) ' Blue Piece
_PaletteColor 4, _RGB32(0, 170, 0) ' Green Piece

DefInt A-Z

Player = 1: Opponant = 2: Move = 0

PieceInHand(1) = 1: PieceInHand(2) = 1
HandY(1) = 638: HandY(2) = 98: Piece1Y(1) = 503: Piece1Y(2) = 98
FinishCount(1) = 0: FinishCount(2) = 0


Arrow1$ = "BU15C3R8U17R8H15G15R8D17R8BU5P3,3"
Arrow2$ = "BU15C4R8U17R8H15G15R8D17R8BU5P4,4"

Line (0, 0)-(1125, 735), 2, BF

' Draw Board
Line (15, 15)-(856, 720), 0, BF
X = 0
For Z = 1 To 5
W = 0
For Y = 1 To 6
If Fix((Z + Y) / 2) = (Z + Y) / 2 Then U = 2 Else U = 1
Line (98 + W - 67, 98 + X - 67)-(98 + W + 67, 98 + X + 67), U, BF
If Z = 1 Then BoardPlayer(Z, Y) = 2: BoardRotate(Z, Y) = 1
If Z = 5 Then BoardPlayer(Z, Y) = 1: BoardRotate(Z, Y) = 1
If Y = 1 Or Y = 6 Then BoardPiece(Z, Y) = 1: If Z = 1 Then BoardRotate(Z, Y) = 3
If Y = 2 Or Y = 5 Then BoardPiece(Z, Y) = 2
If Y = 3 Or Y = 4 Then BoardPiece(Z, Y) = 3
If BoardPlayer(Z, Y) > 0 Then X1 = 98 + W: X2 = 98 + X: X3 = BoardPlayer(Z, Y): X4 = BoardPiece(Z, Y): X5 = BoardRotate(Z, Y): GoSub DrawPiece
BoardX(Z, Y) = 98 + W: BoardY(Z, Y) = 98 + X
W = W + 135
Next
X = X + 135
Next

Color 15, 2: Locate 2, 114: Print "R U S H I";

' Draw Player's Piece in Hand
X1 = 990: X2 = 98: X3 = 2: X4 = 1: X5 = 3: GoSub DrawPiece
X1 = 990: X2 = 638: X3 = 1: X4 = 1: X5 = 1: GoSub DrawPiece

StartGame:
' Draw Player Indicator
X1 = 923: X2 = 368: X3 = Player: X4 = 4: GoSub DrawPiece

Piece = PieceInHand(Player): Rotation = 1

Line (996, 306)-(1120, 430), 2, BF

' End Game if Pieces are on Back Row After 100 Moves
Winner = 0: If Moves = 101 Then If C(1) = 1 And C(2) = 1 Then Winner = 3 Else If C(1) = 1 Then Winner = 2 Else If C(2) = 1 Then Winner = 1
If Winner > 0 Then GoTo Winner

' Check for Players Pieces Still on Back Row at 90 Moves
If Moves > 89 Then
C(1) = 0: C(2) = 0
For Z = 1 To 6
If BoardPlayer(1, Z) = 2 Then C(2) = 1
If BoardPlayer(5, Z) = 1 Then C(1) = 1
Next
End If

' If Player is Still on Back Row, Display Warning.
If C(Player) = 1 Then
Color 15, 2: Locate 22, 126: Print "W A R N I N G";
Color 15, 2: Locate 24, 126: Print "Remove Pieces";
Color 15, 2: Locate 25, 126: Print "From Back Row";
Color 15, 2: Locate 45, 111: Print "Press <ENTER> to Continue.";

GetENTER1: A$ = UCase$(InKey$): If A$ = "" GoTo GetENTER1
If Asc(A$) <> 13 Then GoTo GetENTER1
Line (996, 306)-(1120, 430), 2, BF
End If

'Check For Legal Moves
CanPlay = 0
For Z = 1 To 5
For Y = 1 To 6
W1 = Z: W2 = Y: GoSub CheckLegalMoves
Next
Next

' No Playable Moves
If CanPlay = 0 And LastMove(Player) = 0 Then
SwapPiece = 1: X1 = 1058: X2 = 368: X4 = 5: GoSub DrawPiece
X1 = 990: X2 = HandY(Player): Piece = PieceInHand(Player)
Line (X1 - 62, X2 - 62)-(X1 + 62, X2 + 62), 15, B
GoTo SwapPieces
ElseIf CanPlay = 0 Then
GoTo CantPlay
End If

' Remove Playable Cursors
For Z = 1 To 5
For Y = 1 To 6
If (Z + Y) / 2 = Fix((Z + Y) / 2) Then V = 2 Else V = 1
If Playable(Z, Y) = 1 Then Playable(Z, Y) = 0: Line (BoardX(Z, Y) - 62, BoardY(Z, Y) - 62)-(BoardX(Z, Y) + 62, BoardY(Z, Y) + 62), V, B
Next
Next

' Piece in Hand is a Sigle Arrow
If Piece = 1 Then
Line (923, HandY(Player) - 62)-(1057, HandY(Player) + 62), 2, BF
X = 0: T = 1
For Z = 1 To 2
W = 0
For Y = 1 To 2
X1 = 923 + W: X2 = Piece1Y(Player) + X: X3 = Player: X4 = 1: X5 = T: GoSub DrawPiece
A(T) = X1: B(T) = X2
W = W + 135: T = T + 1
Next
X = X + 135
Next
Color 15, 2: Locate 45, 111: Print " Choose a Piece Rotation. ";

GetRotationMouseInput:
Do While _MouseInput
MouseX = _MouseX: MouseY = _MouseY: MouseLeftButton = _MouseButton(1)

For Z = 1 To 4
If (MouseX > A(Z) - 63) * (MouseX < A(Z) + 63) * (MouseY > B(Z) - 63) * (MouseY < B(Z) + 63) Then
CanSelect = 1: Line (A(Z) - 62, B(Z) - 62)-(A(Z) + 62, B(Z) + 62), 15, B
Else
CanSelect = 0: Line (A(Z) - 62, B(Z) - 62)-(A(Z) + 62, B(Z) + 62), 2, B
End If
If (MouseLeftButton = -1) * (CanSelect = 1) Then
Rotation = Z: GoSub ReleaseMouseButton
Line (A(1) - 62, B(1) - 62)-(A(4) + 62, B(4) + 62), 2, BF
X1 = 990: X2 = HandY(Player): X3 = Player: X4 = 1: X5 = Rotation: GoSub DrawPiece
GoTo GetBoardInput
End If
Next
Loop
GoTo GetRotationMouseInput
Else X1 = 990: X2 = HandY(Player): Piece = PieceInHand(Player): Rotation = 1
End If

GetBoardInput:
' Draw Cursor Around Piece in Hand
Line (X1 - 62, X2 - 62)-(X1 + 62, X2 + 62), 15, B

' Draw Swap Button
X1 = 1058: X2 = 368: X4 = 5: GoSub DrawPiece

Color 15, 2: Locate 45, 111: Print " Choose a Board Location. ";

ChooseALocationMouseInput:
Do While _MouseInput
MouseX = _MouseX: MouseY = _MouseY: MouseLeftButton = _MouseButton(1)
If LastMove(Player) = 0 And MouseLeftButton = -1 And MouseX > 996 And MouseX < 1120 And MouseY > 306 And MouseY < 430 Then SwapPiece = 1: LastMove(Player) = 1: GoTo SwapPieces
For Z = 1 To 5
For Y = 1 To 6
If (MouseLeftButton = -1) * (MouseX > BoardX(Z, Y) - 67) * (MouseX < BoardX(Z, Y) + 67) * (MouseY > BoardY(Z, Y) - 67) * (MouseY < BoardY(Z, Y) + 67) Then
If BoardPlayer(Z, Y) = 0 Then Row = Z: Column = Y: LastMove(Player) = 0: GoTo EndChoice1
End If
Next
Next
Loop
GoTo ChooseALocationMouseInput

EndChoice1:

' Check for Legal Move
W1 = Row: W2 = Column: GoSub CheckLegalMoves
If X = 0 GoTo ChooseALocationMouseInput

' Move Piece from Hand to Board
Line (923, HandY(Player) - 62)-(1057, HandY(Player) + 62), 2, BF

If (Row = 1 And Player = 1) Or (Row = 5 And Player = 2) Then FinishCount(Player) = FinishCount(Player) + 1: Piece = 4

BoardPlayer(Row, Column) = Player: BoardPiece(Row, Column) = Piece: BoardRotate(Row, Column) = Rotation
X1 = BoardX(Row, Column): X2 = BoardY(Row, Column): X3 = Player: X4 = Piece: X5 = Rotation: GoSub DrawPiece

If X4 = 0 Then BoardPlayer(Row, Column) = 0: BoardPiece(Row, Column) = 0: BoardRotate(Row, Column) = 0

' Check for Multiple Pieces to Put in Hand
If X > 1 Then
X = 0: Color 15, 2: Locate 45, 111: Print "Choose Piece to Put in Hand.";
For Z = 1 To 5
For Y = 1 To 6
If (Z + Y) / 2 = Fix((Z + Y) / 2) Then V = 15 Else V = 0
If Playable(Z, Y) Then Line (BoardX(Z, Y) - 62, BoardY(Z, Y) - 62)-(BoardX(Z, Y) + 62, BoardY(Z, Y) + 62), V, B
Next
Next

ChooseAPieceInput:
Do While _MouseInput
MouseX = _MouseX: MouseY = _MouseY: MouseLeftButton = _MouseButton(1)
For Z = 1 To 5
For Y = 1 To 6
If (MouseLeftButton = -1) * (MouseX > BoardX(Z, Y) - 62) * (MouseX < BoardX(Z, Y) + 62) * (MouseY > BoardY(Z, Y) - 62) * (MouseY < BoardY(Z, Y) + 62) Then
If Playable(Z, Y) = 1 Then Row2 = Z: Column2 = Y: GoTo EndChoice2
End If
Next
Next
Loop
GoTo ChooseAPieceInput
Else
For Z = 1 To 5
For Y = 1 To 6
If Playable(Z, Y) = 1 Then Row2 = Z: Column2 = Y: X4 = BoardPiece(Z, Y): X5 = BoardRotate(Z, Y)
Next
Next
End If

EndChoice2:

' Remove Playable Cursors
For Z = 1 To 5
For Y = 1 To 6
If (Z + Y) / 2 = Fix((Z + Y) / 2) Then V = 2 Else V = 1
If Playable(Z, Y) = 1 Then Playable(Z, Y) = 0: Line (BoardX(Z, Y) - 62, BoardY(Z, Y) - 62)-(BoardX(Z, Y) + 62, BoardY(Z, Y) + 62), V, B
Next
Next

' Move Piece from Board To Hand
If (Row2 + Column2) / 2 = Fix((Row2 + Column2) / 2) Then V = 2 Else V = 1
Line (BoardX(Row2, Column2) - 62, BoardY(Row2, Column2) - 62)-(BoardX(Row2, Column2) + 62, BoardY(Row2, Column2) + 62), V, BF

X1 = 990: X2 = HandY(Player): X3 = Player: X4 = BoardPiece(Row2, Column2): PieceInHand(Player) = X4
If X4 = 1 And Player = 2 Then X5 = 3 Else X5 = 1

BoardPlayer(Row2, Column2) = 0: BoardPiece(Row2, Column2) = 0: BoardRotate(Row2, Column2) = 0: GoSub DrawPiece

' Draw Color Circles at Ends of Board
If Row2 = 1 Or Row2 = 5 Then
X1 = BoardX(Row2, Column2): X2 = BoardY(Row2, Column2)
If (Row2 + Column2) / 2 = Fix((Row2 + Column2) / 2) Then V = 1 Else V = 2
If Row2 = 1 Then U = 4 Else U = 3
Circle (X1, X2), 15, U: Paint (X1, X2), U: Circle (X1, X2), 12, V: Paint (X1, X2), V
End If

SwapPieces:
If SwapPiece = 1 Then
SwapPiece = 0: Line (996, 306)-(1120, 430), 15, B

Color 15, 2: Locate 45, 111: Print " Choose Piece to Swap With. ";

ChooseSwapPieceInput:
Do While _MouseInput
MouseX = _MouseX: MouseY = _MouseY: MouseLeftButton = _MouseButton(1)
For Z = 1 To 5
For Y = 1 To 6
If (MouseLeftButton = -1) * (MouseX > BoardX(Z, Y) - 62) * (MouseX < BoardX(Z, Y) + 62) * (MouseY > BoardY(Z, Y) - 62) * (MouseY < BoardY(Z, Y) + 62) Then
If BoardPlayer(Z, Y) = Player Then Row1 = Z: Column1 = Y: GoTo EndChoice3
End If
Next
Next
Loop
GoTo ChooseSwapPieceInput

EndChoice3:
TempPiece = Piece: TempRotate = Rotation
PieceInHand(Player) = BoardPiece(Row1, Column1): HandRotate(Player) = BoardRotate(Row1, Column1)
BoardPiece(Row1, Column1) = TempPiece: BoardRotate(Row1, Column1) = TempRotate

If (Row1 + Column1) / 2 = Fix((Row1 + Column1) / 2) Then V = 2 Else V = 1
Line (BoardX(Row1, Column1) - 62, BoardY(Row1, Column1) - 62)-(BoardX(Row1, Column1) + 62, BoardY(Row1, Column1) + 62), V, BF
X1 = BoardX(Row1, Column1): X2 = BoardY(Row1, Column1): X3 = Player: X4 = BoardPiece(Row1, Column1): X5 = BoardRotate(Row1, Column1): GoSub DrawPiece

Line (923, HandY(Player) - 62)-(1057, HandY(Player) + 62), 2, BF
If Player = 1 Then X5 = 1 Else X5 = 3
X1 = 990: X2 = HandY(Player): X3 = Player: X4 = PieceInHand(Player): GoSub DrawPiece

Line (996, 306)-(1120, 430), 2, BF
End If

' Check for Winner
If FinishCount(Player) = 6 Then Winner = Player: GoTo Winner

CantPlay:
If CanPlay = 0 Then
Color 15, 2: Locate 45, 111: Print " No Playable Moves. <ENTER> ";
GetENTER: A$ = UCase$(InKey$): If A$ = "" GoTo GetENTER
If Asc(A$) <> 13 Then GoTo GetENTER
End If

Move = Move + 1: Swap Player, Opponant: GoTo StartGame


DrawPiece:
If X4 = 4 And X3 = 1 Then V = 3 Else If X4 = 4 And X3 = 2 Then V = 4 Else V = 15

Line (X1 - 47, X2 - 57)-(X1 + 47, X2 - 57), 0
Line (X1 - 57, X2 - 47)-(X1 - 57, X2 + 47), 0
Line (X1 - 47, X2 + 57)-(X1 + 47, X2 + 57), 0
Line (X1 + 57, X2 - 47)-(X1 + 57, X2 + 47), 0
Circle (X1 - 47, X2 - 47), 10, 0, 1.5, 3.1
Circle (X1 - 47, X2 + 47), 10, 0, 3.1, 4.8
Circle (X1 + 47, X2 + 47), 10, 0, 4.6, 0
Circle (X1 + 47, X2 - 47), 10, 0, 0, 1.7
Paint (X1, X2), V, 0

If X4 = 5 Then Color 0, 15: Locate 24, 130: Print "S W A P";

If V < 15 Then Return

If X3 = 1 Then
If (X4 = 1 And X5 = 1) Or X4 = 3 Then PSet (X1, X2), 15: Draw "TA0" + Arrow1$
If (X4 = 1 And X5 = 2) Or X4 = 3 Then PSet (X1, X2), 15: Draw "TA270" + Arrow1$
If (X4 = 1 And X5 = 3) Or X4 = 3 Then PSet (X1, X2), 15: Draw "TA180" + Arrow1$
If (X4 = 1 And X5 = 4) Or X4 = 3 Then PSet (X1, X2), 15: Draw "TA90" + Arrow1$
If X4 = 2 Then PSet (X1, X2), 15: Draw "TA315BU10" + Arrow1$
If X4 = 2 Then PSet (X1, X2), 15: Draw "TA225BU10" + Arrow1$
If X4 = 2 Then PSet (X1, X2), 15: Draw "TA135BU10" + Arrow1$
If X4 = 2 Then PSet (X1, X2), 15: Draw "TA45BU10" + Arrow1$
Else
If (X4 = 1 And X5 = 1) Or X4 = 3 Then PSet (X1, X2), 15: Draw "TA0" + Arrow2$
If (X4 = 1 And X5 = 2) Or X4 = 3 Then PSet (X1, X2), 15: Draw "TA270" + Arrow2$
If (X4 = 1 And X5 = 3) Or X4 = 3 Then PSet (X1, X2), 15: Draw "TA180" + Arrow2$
If (X4 = 1 And X5 = 4) Or X4 = 3 Then PSet (X1, X2), 15: Draw "TA90" + Arrow2$
If X4 = 2 Then PSet (X1, X2), 15: Draw "TA315BU10" + Arrow2$
If X4 = 2 Then PSet (X1, X2), 15: Draw "TA225BU10" + Arrow2$
If X4 = 2 Then PSet (X1, X2), 15: Draw "TA135BU10" + Arrow2$
If X4 = 2 Then PSet (X1, X2), 15: Draw "TA45BU10" + Arrow2$
End If
Return


ReleaseMouseButton:
Do While _MouseInput
If _MouseButton(1) = 0 Then Return
Loop
GoTo ReleaseMouseButton


CheckLegalMoves:
X = 0
If W1 - 1 >= 1 Then If BoardPlayer(W1 - 1, W2) = Player Then If (BoardPiece(W1 - 1, W2) = 1 And BoardRotate(W1 - 1, W2) = 3) Or BoardPiece(W1 - 1, W2) = 3 Then X = X + 1: Playable(W1 - 1, W2) = 1
If W1 - 1 >= 1 And W2 + 1 <= 6 Then If BoardPlayer(W1 - 1, W2 + 1) = Player Then If BoardPiece(W1 - 1, W2 + 1) = 2 Then X = X + 1: Playable(W1 - 1, W2 + 1) = 1
If W2 + 1 <= 6 Then If BoardPlayer(W1, W2 + 1) = Player Then If (BoardPiece(W1, W2 + 1) = 1 And BoardRotate(W1, W2 + 1) = 4) Or BoardPiece(W1, W2 + 1) = 3 Then X = X + 1: Playable(W1, W2 + 1) = 1
If W1 + 1 <= 5 And W2 + 1 <= 6 Then If BoardPlayer(W1 + 1, W2 + 1) = Player Then If BoardPiece(W1 + 1, W2 + 1) = 2 Then X = X + 1: Playable(W1 + 1, W2 + 1) = 1
If W1 + 1 <= 5 Then If BoardPlayer(W1 + 1, W2) = Player Then If (BoardPiece(W1 + 1, W2) = 1 And BoardRotate(W1 + 1, W2) = 1) Or BoardPiece(W1 + 1, W2) = 3 Then X = X + 1: Playable(W1 + 1, W2) = 1
If W1 + 1 <= 5 And W2 - 1 >= 1 Then If BoardPlayer(W1 + 1, W2 - 1) = Player Then If BoardPiece(W1 + 1, W2 - 1) = 2 Then X = X + 1: Playable(W1 + 1, W2 - 1) = 1
If W2 - 1 >= 1 Then If BoardPlayer(W1, W2 - 1) = Player Then If (BoardPiece(W1, W2 - 1) = 1 And BoardRotate(W1, W2 - 1) = 2) Or BoardPiece(W1, W2 - 1) = 3 Then X = X + 1: Playable(W1, W2 - 1) = 1
If W1 - 1 >= 1 And W2 - 1 >= 1 Then If BoardPlayer(W1 - 1, W2 - 1) = Player Then If BoardPiece(W1 - 1, W2 - 1) = 2 Then X = X + 1: Playable(W1 - 1, W2 - 1) = 1
If X > 0 Then CanPlay = 1
Return


Winner:
Line (861, 306)-(1120, 430), 2, BF

If Winner = 3 Then
Color 15, 2: Locate 22, 111: Print " After 100 Moves ";
Color 15, 2: Locate 23, 111: Print "Both Have Pieces in Back Row";
Color 15, 2: Locate 25, 111: Print "The Game Ended in a D R A W!";
Else
X1 = 923: X2 = 368: X3 = Winner: X4 = 4: GoSub DrawPiece
Color 15, 2: Locate 24, 126: Print "W I N N E R !";
End If

Color 15, 2: Locate 45, 111: Print "Play Another Game? (Y or N)";
GetYesNo: A$ = UCase$(InKey$): If A$ = "" GoTo GetYesNo
If A$ = "Y" Then Run
If A$ = "N" Then System
GoTo GetYesNo
Reply




Users browsing this thread: 1 Guest(s)