Laser Chess Board Game - SMcNeill - 12-24-2023
Quote:Laser Chess
Laser Chess is a computer board game releasedin 1987. Many different versions hasbeen released over the years in pc and real board game form with different pieces and different rules. This is my take on the original version.
The objectof the game is to either capture or destroy your enemy’s King. Most of the game is spent arranging mirrors to set up to fire your Laser. All the pieces the same 1 space up, down, right or left. Each turn consist of 2 moves. a move consist of moving a pieces or rotating a piece or firing your laser. You can rotate a pieces and moves it to a new location in 1 turn counts as 2 moves. On a turn you also move 2 separate pieces or moves 1 piece twice. All pieces can be rotated except the King and the Hyper-cube.
Only the King and the Block can capture an enemy’s piece.All pieces can be captured except the Hypercube. The Hypercube also can not be destroyed. The Hypercube when placed onto another piece, it causes that piece to disappear and re-appear at a random vacant location on the board. The Hypercube can only be used once per turn. The Triangle Mirror deflects the beam 90 degrees. The Triangle Mirror can be destroyed if hit at 1 of the non-mirror sides. The Diagonal Mirror also deflect the beam 90 degrees, bu can not be destroyed. The Block has a mirror on 1 side and can be hit on the other 3 sides. Again, the Block can captures enemy pieces. Then Straight Mirror can not be destroyed. If the Straight Mirror or the Block is hit straight on, the beam is returned by to the source and the Laser that fired the beam is destroyed.
The center of the board is called the Hyper Square and isa fixed Hypercube. When a piece lands in the Hyper Square, that piece is transported to a random vacant location.
I used a code snippet by bplus to enlarge the size of the characters.
Donald
Laser Chess Rules.docx (Size: 49.68 KB / Downloads: 35)
Code: (Select All)
_Title "Laser Chess - Designed by Mike Duppong 1987 - Programmed by Donald L. Foster Jr. 2018 - Code Sniplet by bplus"
' Laser Chess was released in COMPUTE! magazine 1987. Code listed in BASIC and Machine Language for Amiga, Commodore 64, Apple II, and Atari 8-bit family.
' I got a copy of it around 1989 that ran on the IBC PC version. I started making this game in 1989, but did not complete it.
' It has been re-made with different names, different pieces and with different rules.
' Back then I thought about making the real board game, but never got around to it. I was even going to attemp to make a 3D real board game 9 x 9 x 9.
' The mirrors would not only reflect the beam horizontal and vertical, but up and down then levels also.
' I used a code siplet by bplus to enlarge the characters on the screen.
Screen _NewImage(1014, 735, 256)
_PaletteColor 1, _RGB32(255, 128, 0) ' Backgraound
_PaletteColor 2, _RGB32(0, 152, 254) ' Blue Square
_PaletteColor 3, _RGB32(128, 0, 128) ' Purple Piece
_PaletteColor 4, _RGB32(0, 0, 200) ' Green Piece
_PaletteColor 5, _RGB32(255, 0, 0) ' Laser Beam
_PaletteColor 6, _RGB32(40, 40, 40) ' Light Grey
_PaletteColor 7, _RGB32(20, 20, 20) ' Dark Grey
_PaletteColor 8, _RGB32(255, 255, 0) ' Yellow
_Limit 10
Randomize Timer
DefInt A-Z
Dim Hit$(10)
Player = 1: Opponent = 2
PlayerColor(1) = 3: PlayerColor(2) = 4
PieceRotations(1) = 4: PieceRotations(2) = 2: PieceRotations(3) = 2: PieceRotations(4) = 4: PieceRotations(5) = 4: PieceRotations(6) = 1: PieceRotations(7) = 4: PieceRotations(8) = 1
' Setup Board Players
For Z = 1 To 9: BoardPlayer(1, Z) = 2: BoardPlayer(2, Z) = 2: BoardPlayer(8, Z) = 1: BoardPlayer(9, Z) = 1: Next
' Setup Board Pieces
Data 1,1,1,1,1,4,4,1,3,4,4,3,7,5,2,6,8,2,2,8,6,2,5,7,3,4,4,3,1,4,4,1,1,1,1,1
For Z = 1 To 9: Read BoardPiece(1, Z), BoardPiece(2, Z), BoardPiece(8, Z), BoardPiece(9, Z): Next
' Setup Board Rotate
Data 4,3,2,1,4,4,2,1,2,4,2,1,2,2,2,1,1,1,1,1,1,2,4,4,1,4,2,2,3,4,2,2,3,4,1,2
For Z = 1 To 9: Read BoardRotate(1, Z), BoardRotate(2, Z), BoardRotate(8, Z), BoardRotate(9, Z): Next
Rotate$(1) = "TA0": Rotate$(2) = "TA90": Rotate$(3) = "TA180": Rotate$(4) = "TA270"
HyperSquare$ = "BU33BL33C15D66R66U66L66BF3D60R60U60L60BH1P15,15"
Piece$(1, 1) = "BL29BU22C3D50R50H50BD5BR2P3,3L2U5E1C15F50": Piece$(2, 1) = "BL29BU23C4D50R50H50BD5BR2P4,4L2U5E1C15F50"
Piece$(1, 2) = "BL33C3D2R66U4L66D2BR2P3,3L2D3C15R66BU6L66": Piece$(2, 2) = "BL33C4D2R66U4L66D2BR2P4,4L2D3C15R66BU6L66"
Piece$(1, 3) = "BG30C3F1E60H2G60BR2P3,3L2F3C15E60BH4G60": Piece$(2, 3) = "BG30C4F1E60H2G60BR2P4,4L2F3C15E60BH4G60"
Piece$(1, 4) = "BR28BD29C3U58L57D58R57BH5P3,3F5C15U58": Piece$(2, 4) = "BR28BD29C4U58L57D58R57BH5P4,4F5C15U58"
Piece$(1, 5) = "BL29BD25C3E25H25D50BU5BR2P3,3L2D5F1C15E26H26": Piece$(2, 5) = "BL29BD25C4E25H25D50BU5BR2P4,4L2D5F1C15E26H26"
Piece$(1, 6) = "TA0BU33BL33C3D66R66U66L66BF3D60R60U60L60BH1P3,3": Piece$(2, 6) = "TA0BU33BL33C4D66R66U66L66BF3D60R60U60L60BH1P4,4"
Piece$(1, 7) = "BR29C3D25H22L23U6R23E22D25BL5P3,3": Piece$(2, 7) = "BR29C4D25H22L23U6R23E22D25BL 5P4,4"
Piece$(1, 8) = "TA0BU33C3G33F33E33H33BD7BL2G24R24U24BR4F24L24U24BD28D24E24L24BL4L24F24U24BR2P3,3": Piece$(2, 8) = "TA0BU33C4G33F33E33H33BD7BL2G24R24U24BR4F24L24U24BD28D24E24L24BL4L24F24U24BR2P4,4"
LaserBeam$(1) = "BL17BD1C5L21U2R21D2BH1P5,5" ' Fire Laser
LaserBeam$(2) = "BL38BD1C5R77U2L77D2BE1P5,5BR70P5,5" ' Straight Through
LaserBeam$(3) = "BR38BD1C5L8U2R8D2BH1P5,5" ' Side of Block and Triangle Hit
LaserBeam$(4) = "BR38BD1C5L5U2R5D2BH1P5,5" 'King Hit
LaserBeam$(5) = "BR38BD1C5L39U39R2D37R37D2BH1P5,5" ' Triangle Piece Deflection
LaserBeam$(6) = "BR38BD1C5L31H9U31R2D32U3BL1P5,5R1D3F6R32D2BH1P5,5" ' Diagnol Piece Deflection
LaserBeam$(7) = "BR38BD1C5U2L37U37L2D77R2U38R37BH1P5,5" ' Full Beam Splitter
LaserBeam$(8) = "BR38BD1C5L34U2R34D2BH1P5,5" ' Laser Side Hit
LaserBeam$(9) = "BR38BD1C5L34U2R34D2BH1P5,5" ' Hit Side on Straight Mirror
Cursor$ = "BU38BL38D76R76U76L75D75R74U74L74"
Hit$(0) = " N O N E "
Hit$(1) = " Opponent's King "
Hit$(2) = " Your King "
Hit$(3) = " Opponent's Laser "
Hit$(4) = " Your Laser "
Hit$(5) = "Opponent's Beam Splitter"
Hit$(6) = " Your Beam Splitter "
Hit$(7) = " Opponent's Block "
Hit$(8) = " Your Block "
Hit$(9) = " Opponent's Mirror "
Hit$(10) = " Your Mirror "
Message$ = " LASER CHESS ": X1 = 95: X2 = 200: X3 = 15: X4 = 8: X5 = 4: GoSub DrawMessage
Message$ = " START ": X1 = 400: X2 = 400: X3 = 8: X4 = 4: X5 = 5: GoSub DrawMessage
Line (0, 0)-(100, 30), 0, BF: Circle (920, 252), 20, 5: Paint (920, 251), 5: Line (0, 249)-(900, 254), 5, BF
PressStartMouseInput:
Do While _MouseInput
MouseX = _MouseX: MouseY = _MouseY: MouseLeftButton = _MouseButton(1)
If (MouseX > 414) * (MouseX < 606) * (MouseY > 390) * (MouseY < 465) Then
CanSelect = 1: Line (414, 390)-(606, 465), 15, B
Else
CanSelect = 0: Line (414, 390)-(606, 465), 0, B
End If
If (MouseLeftButton = -1) * (CanSelect = 1) Then GoSub ReleaseMouseButton: GoTo Start
Loop
GoTo PressStartMouseInput
Start:
Cls , 1 ' Set Background Color
Line (770, 662)-(970, 712), 7, BF
Message$ = " LASER": X1 = 705: X2 = 0: X3 = 0: X4 = 6: X5 = 1: GoSub DrawMessage
Message$ = " CHESS": X1 = 705: X2 = 70: X3 = 15: X4 = 6: X5 = 2: GoSub DrawMessage
Message$ = " Fire Laser": X1 = 775: X2 = 673: X3 = 5: X4 = 2: X5 = 3: GoSub DrawMessage
Line (0, 0)-(100, 30), 1, BF: Circle (1000, 38), 8, 5: Paint (1000, 38), 5: Line (726, 37)-(1000, 39), 5, BF
' Draw Fire Laser Button
PSet (970, 662), 7: Draw "L200D50NG10R200U50E10L220D70R220U70BL10BD8P6,7BR8P0,7"
' Draw Board
Line (10, 10)-(725, 725), 15, BF: Line (15, 15)-(720, 720), 0, BF
X = 60
For Z = 1 To 9
V = 60
For Y = 1 To 9
If (Z + Y) / 2 = Int((Z + Y) / 2) Then T = 2: X6 = 2 Else T = 0: X6 = 0
Line (V - 38, X - 38)-(V + 38, X + 38), T, BF
If BoardPlayer(Z, Y) > 0 Then X1 = V: X2 = X: X3 = BoardPlayer(Z, Y): X4 = BoardPiece(Z, Y): X5 = BoardRotate(Z, Y): GoSub DrawPiece
If Z = 5 And Y = 5 Then PSet (V, X), 2: Draw HyperSquare$
BoardX(Z, Y) = V: BoardY(Z, Y) = X
V = V + 77
Next
X = X + 77
Next
StartGame:
MovesLeft = 2: LaserFired = 0: HyperSquare = 0
' Display Player Indicators
X1 = 766: X2 = 613: X3 = Player: X4 = 7: X5 = 4: X6 = 1: GoSub DrawPiece
X1 = 765: X2 = 182: X3 = Player: X4 = 1: X5 = 4: X6 = 1: GoSub DrawPiece
X1 = 975: X2 = 182: X3 = Player: X4 = 1: X5 = 3: X6 = 1: GoSub DrawPiece
X1 = 974: X2 = 613: X3 = Opponent: X4 = 8: X5 = 2: X6 = 1: GoSub DrawPiece
PSet (765, 596), 5: Draw "U416R210D401L2U399L206D414L2BE1P5,5"
Color 0, 1: Locate 14, 106: Print "Player"; Player;
MovesLeft: Color 0, 1: Locate 40, 103: Print "Moves Left:"; MovesLeft;
' Set All Playable Moves to 0
For Z = 1 To 9: For Y = 1 To 9: Playable(Z, Y) = 0: Next: Next
Color 0, 1: Locate 16, 101: Print " Choose a Piece ";
Color 0, 1: Locate 18, 101: Print " or Fire Laser ";
ChooseAPieceInput:
Do While _MouseInput
MouseX = _MouseX: MouseY = _MouseY: MouseLeftButton = _MouseButton(1)
If MouseLeftButton = -1 And LaserFired = 0 And MouseX > 759 And MouseX < 981 And MouseY > 651 And MouseY < 723 Then GoSub ReleaseMouseButton: GoTo FireLaser
For Z = 1 To 9
For Y = 1 To 9
If (MouseLeftButton = -1) * (MouseX > BoardX(Z, Y) - 38) * (MouseX < BoardX(Z, Y) + 38) * (MouseY > BoardY(Z, Y) - 38) * (MouseY < BoardY(Z, Y) + 38) Then
If BoardPlayer(Z, Y) = Player Then Row1 = Z: Column1 = Y: GoSub ReleaseMouseButton: GoTo EndChoice1
End If
Next
Next
Loop
GoTo ChooseAPieceInput
EndChoice1:
Piece = BoardPiece(Row1, Column1)
Rotate = BoardRotate(Row1, Column1)
Rotations = PieceRotations(BoardPiece(Row1, Column1))
BoardX1 = BoardX(Row1, Column1): BoardY1 = BoardY(Row1, Column1)
' Get Board Square Color
If (Row1 + Column1) / 2 = Fix((Row1 + Column1) / 2) Then SquareColor1 = 2 Else SquareColor1 = 0
' Check Playable Moves
Playable(Row1, Column1) = 1
If Column1 - 1 >= 1 Then
If Row1 = 5 And Column1 - 1 = 5 Then Playable(5, 5) = 1
If BoardPiece(Row1, Column1) = 6 Then Playable(Row1, Column1 - 1) = 1
If BoardPlayer(Row1, Column1 - 1) = 0 Then Playable(Row1, Column1 - 1) = 1
If (BoardPiece(Row1, Column1) = 4 Or BoardPiece(Row1, Column1) = 8) And BoardPlayer(Row1, Column1 - 1) <> Player Then Playable(Row1, Column1 - 1) = 1
End If
If Row1 + 1 <= 9 Then
If Row1 + 1 = 5 And Column1 = 5 Then Playable(5, 5) = 1
If BoardPiece(Row1, Column1) = 6 Then Playable(Row1 + 1, Column1) = 1
If BoardPlayer(Row1 + 1, Column1) = 0 Then Playable(Row1 + 1, Column1) = 1
If (BoardPiece(Row1, Column1) = 4 Or BoardPiece(Row1, Column1) = 8) And BoardPlayer(Row1 + 1, Column1) <> Player Then Playable(Row1 + 1, Column1) = 1
End If
If Column1 + 1 <= 9 Then
If Row1 = 5 And Column1 + 1 = 5 Then Playable(5, 5) = 1
If BoardPiece(Row1, Column1) = 6 Then Playable(Row1, Column1 + 1) = 1
If BoardPlayer(Row1, Column1 + 1) = 0 Then Playable(Row1, Column1 + 1) = 1
If (BoardPiece(Row1, Column1) = 4 Or BoardPiece(Row1, Column1) = 8) And BoardPlayer(Row1, Column1 + 1) <> Player Then Playable(Row1, Column1 + 1) = 1
End If
If Row1 - 1 >= 1 Then
If Row1 - 1 = 5 And Column1 = 5 Then Playable(5, 5) = 1
If BoardPiece(Row1, Column1) = 6 Then Playable(Row1 - 1, Column1) = 1
If BoardPlayer(Row1 - 1, Column1) = 0 Then Playable(Row1 - 1, Column1) = 1
If (BoardPiece(Row1, Column1) = 4 Or BoardPiece(Row1, Column1) = 8) And BoardPlayer(Row1 - 1, Column1) <> Player Then Playable(Row1 - 1, Column1) = 1
End If
PSet (BoardX1, BoardY1), Point(BoardX1, BoardY1): Draw "C15" + Cursor$
' Check If Piece Can Be Rotated
If Rotations > 1 Then
Color 0, 1: Locate 16, 101: Print "Choose a Rotation";
Color 0, 1: Locate 18, 101: Print " ";
X = 307
For Z = 1 To Rotations
X1 = 869: X2 = X: X3 = Player: X4 = Piece: X5 = Z: X6 = 1: GoSub DrawPiece
B(Z) = X: X = X + 90
Next
GetRotationMouseInput:
Do While _MouseInput
MouseX = _MouseX: MouseY = _MouseY: MouseLeftButton = _MouseButton(1)
For Z = 1 To Rotations
If (MouseX > 831) * (MouseX < 908) * (MouseY > B(Z) - 39) * (MouseY < B(Z) + 39) Then
CanSelect = 1: Line (831, B(Z) - 38)-(907, B(Z) + 38), 15, B
Else
CanSelect = 0: Line (831, B(Z) - 38)-(907, B(Z) + 38), 1, B
End If
If (MouseLeftButton = -1) * (CanSelect = 1) Then Rotation = Z: GoSub ReleaseMouseButton: GoTo EndChoice2
Next
Loop
GoTo GetRotationMouseInput
EndChoice2:
If Rotation <> Rotate Then MovesLeft = MovesLeft - 1: Color 0, 1: Locate 40, 103: Print "Moves Left:"; MovesLeft;
If MovesLeft = 0 Then
' Remove Piece Rotations
Line (831, 269)-(907, 630), 1, BF
' Set Current Piece To New Rotation Position
BoardRotate(Row1, Column1) = Rotation
' Remove Cursor and Piece From Current Location
Line (BoardX1 - 38, BoardY1 - 38)-(BoardX1 + 38, BoardY1 + 38), SquareColor1, BF
' Redraw Piece in Current Position With New Rotation
X1 = BoardX1: X2 = BoardY1: X3 = Player: X4 = Piece: X5 = Rotation: X6 = SquareColor1: GoSub DrawPiece: GoTo EndTurn
End If
Else Rotation = Rotate
End If
Color 0, 1: Locate 16, 101: Print "Choose a Location";
'COLOR 0, 1: LOCATE 18, 101: PRINT " ";
ChooseALocationInput:
Do While _MouseInput
MouseX = _MouseX: MouseY = _MouseY: MouseLeftButton = _MouseButton(1)
If MouseLeftButton = -1 And MouseX > 759 And MouseX < 981 And MouseY > 651 And MouseY < 723 Then GoSub ReleaseMouseButton: GoTo FireLaser
For Z = 1 To 9
For Y = 1 To 9
If (MouseLeftButton = -1) * (MouseX > BoardX(Z, Y) - 38) * (MouseX < BoardX(Z, Y) + 38) * (MouseY > BoardY(Z, Y) - 38) * (MouseY < BoardY(Z, Y) + 38) Then
If Playable(Z, Y) = 1 Then Row2 = Z: Column2 = Y: GoSub ReleaseMouseButton: GoTo EndChoice3
End If
Next
Next
Loop
GoTo ChooseALocationInput
EndChoice3:
BoardX2 = BoardX(Row2, Column2): BoardY2 = BoardY(Row2, Column2)
If (Row2 + Column2) / 2 = Fix((Row2 + Column2) / 2) Then SquareColor2 = 2 Else SquareColor2 = 0
' Get New Location Information
Player2 = BoardPlayer(Row2, Column2): Piece2 = BoardPiece(Row2, Column2): Rotate2 = BoardRotate(Row2, Column2)
' Piece stayed at Same Location
If Row2 = Row1 And Column2 = Column1 Then
Line (BoardX1 - 38, BoardY1 - 38)-(BoardX1 + 38, BoardY1 + 38), SquareColor1, BF
BoardRotate(Row2, Column2) = Rotation: X1 = BoardX2: X2 = BoardY2: X3 = Player: X4 = Piece: X5 = Rotation: X6 = SquareColor1: GoSub DrawPiece
Line (831, 269)-(907, 630), 1, BF: GoTo MovesLeft
End If
' Check if Move is HyperCuber or Hyper Square
If BoardPiece(Row1, Column1) = 6 Or (Row2 = 5 And Column2 = 5) Then
X = 0
While (X = 0)
Row3 = Int(Rnd * 9) + 1: Column3 = Int(Rnd * 9) + 1: If BoardPlayer(Row3, Column3) = 0 Then X = 1
If Row3 = 5 And Column3 = 5 Then X = 0
Wend
BoardX3 = BoardX(Row3, Column3): BoardY3 = BoardY(Row3, Column3)
If (Row3 + Column3) / 2 = Fix((Row3 + Column3) / 2) Then SquareColor3 = 2: C$ = "C2" Else SquareColor3 = 0: C$ = "C0"
If BoardPiece(Row1, Column1) = 6 Then
BoardPlayer(Row3, Column3) = Player2: BoardPiece(Row3, Column3) = Piece2: BoardRotate(Row3, Column3) = Rotate2
BoardPlayer(Row2, Column2) = Player: BoardPlayer(Row2, Column2) = 6: BoardRotate(Row2, Column2) = 1
BoardPlayer(Row1, Column1) = 0: BoardPiece(Row1, Column1) = 0: BoardRotate(Row1, Column1) = 0
Line (BoardX1 - 38, BoardY1 - 38)-(BoardX1 + 38, BoardY1 + 38), SquareColor1, BF
Line (BoardX2 - 38, BoardY2 - 38)-(BoardX2 + 38, BoardY2 + 38), SquareColor2, BF
X1 = BoardX2: X2 = BoardY2: X3 = Player: X4 = 6: X5 = 1: GoSub DrawPiece
X1 = BoardX3: X2 = BoardY3: X3 = BoardPlayer(Row3, Column3): X4 = BoardPiece(Row3, Column3): X5 = BoardRotate(Row3, Column3): GoSub DrawPiece
End If
If Row2 = 5 And Column2 = 5 Then
BoardPlayer(Row3, Column3) = Player: BoardPiece(Row3, Column3) = Piece: BoardRotate(Row3, Column3) = Rotation
BoardPlayer(Row1, Column1) = 0: BoardPiece(Row1, Column1) = 0: BoardRotate(Row1, Column1) = 0
Line (BoardX1 - 38, BoardY1 - 38)-(BoardX1 + 38, BoardY1 + 38), SquareColor1, BF
Line (BoardX2 - 38, BoardY2 - 38)-(BoardX2 + 38, BoardY2 + 38), SquareColor2, BF
X1 = BoardX3: X2 = BoardY3: X3 = Player: X4 = Piece: X5 = Rotation: GoSub DrawPiece
End If
' Remove Piece Rotations
Line (831, 269)-(907, 630), 1, BF
Color 0, 1: Locate 16, 101: Print "Piece Transported"
Color 0, 1: Locate 18, 98: Print "Press ENTER to Continue";
MovesLeft = MovesLeft - 1: Color 0, 1: Locate 40, 103: Print "Moves Left:"; MovesLeft;
GetENTER2: A$ = InKey$
If A$ = "" Then
PSet (BoardX3, BoardY3), Point(BoardX3, BoardY3): Draw "C8" + Cursor$: _Delay .2
PSet (BoardX3, BoardY3), Point(BoardX3, BoardY3): Draw C$ + Cursor$: _Delay .2
GoTo GetENTER2
End If
If Asc(A$) <> 13 Then GoTo GetENTER2
Color 0, 1: Locate 18, 98: Print " ";
If MovesLeft > 0 Then GoTo MovesLeft
End If
' Asign New Location to Player
BoardPlayer(Row2, Column2) = Player: BoardPiece(Row2, Column2) = Piece: BoardRotate(Row2, Column2) = Rotation
' Set Old Location to 0
BoardPlayer(Row1, Column1) = 0: BoardPiece(Row1, Column1) = 0: BoardRotate(Row1, Column1) = 0
' Clear Piece and Cursors From Old Location
Line (BoardX1 - 38, BoardY1 - 38)-(BoardX1 + 38, BoardY1 + 38), SquareColor1, BF
' Clear New Location
Line (BoardX2 - 38, BoardY2 - 38)-(BoardX2 + 38, BoardY2 + 38), SquareColor2, BF
' Redraw Piece at New Location
X1 = BoardX2: X2 = BoardY2: X3 = Player: X4 = Piece: X5 = Rotation: GoSub DrawPiece
' Remove Piece Rotations
Line (831, 269)-(907, 650), 1, BF
' Check If Piece Captured is Opponents King
If Player2 = Opponent And Piece2 = 8 And (Piece = 4 Or Piece = 8) Then
Color 0, 1: Locate 16, 101: Print " W I N N E R ! ";
Color 0, 1: Locate 18, 101: Print " King Captured ";
Color 0, 1: Locate 39, 100: Print "Play Another Game?";
Color 0, 1: Locate 40, 100: Print " Yes or No ";
GoTo AnotherGame
End If
MovesLeft = MovesLeft - 1: Color 0, 1: Locate 40, 103: Print "Moves Left:"; MovesLeft;
EndTurn:
If MovesLeft > 0 GoTo MovesLeft
Swap Player, Opponent: GoTo StartGame
ReleaseMouseButton:
Do While _MouseInput
If _MouseButton(1) = 0 Then Return
Loop
GoTo ReleaseMouseButton
DrawMessage:
If X5 > 3 Then V = 0 Else V = 1
Color 15, V: Locate 1, 1: Print Message$;
w = 8 * Len(Message$): h = 16
If X5 = 1 Then Dim p(w, h)
If X5 = 2 Then Dim q(w, h)
If X5 = 3 Then Dim r(w, h)
If X5 = 4 Then Dim s(w, h)
If X5 = 5 Then Dim t(w, h)
For Y = 0 To h
For X = 0 To w
If X5 = 1 Then If Point(X, Y) <> 1 Then p(X, Y) = 2
If X5 = 2 Then If Point(X, Y) <> 1 Then q(X, Y) = 2
If X5 = 3 Then If Point(X, Y) <> 1 Then r(X, Y) = 2
If X5 = 4 Then If Point(X, Y) <> 0 Then s(X, Y) = 2
If X5 = 5 Then If Point(X, Y) <> 0 Then t(X, Y) = 2
Next
Next
For Y = 0 To h - 1
For X = 0 To w - 1
If X5 = 1 Then If p(X, Y) > 1 Then V = X3 Else V = 1
If X5 = 2 Then If q(X, Y) > 1 Then V = X3 Else V = 1
If X5 = 3 Then If r(X, Y) > 1 Then V = X3 Else V = 7
If X5 = 4 Then If s(X, Y) > 0 Then V = X3 Else V = 0
If X5 = 5 Then If t(X, Y) > 0 Then V = X3 Else V = 0
Line (X1 + X * X4, X2 + Y * X4)-(X1 + X * X4 + X4, X2 + Y * X4 + X4), V, BF
Next
Next
Return
DrawPiece: PSet (X1, X2), X6: Draw Rotate$(X5) + Piece$(X3, X4): Return
UpdateBoard:
For Z = 1 To 9
For Y = 1 To 9
BoardX = BoardX(Z, Y): BoardY = BoardY(Z, Y): If (Z + Y) / 2 = Fix((Z + Y) / 2) Then SquareColor = 2 Else SquareColor = 0
Line (BoardX - 39, BoardY - 39)-(BoardX + 39, BoardY + 39), SquareColor, BF
If Z = 5 And Y = 5 Then PSet (BoardX, BoardY), 2: Draw HyperSquare$
If BoardPlayer(Z, Y) > 0 Then X1 = BoardX: X2 = BoardY: X3 = BoardPlayer(Z, Y): X4 = BoardPiece(Z, Y): X5 = BoardRotate(Z, Y): X6 = SquareColor: GoSub DrawPiece
Next
Next
Return
FireLaser:
For Z = 1 To 3: BeamDirection(Z) = 0: Hit(Z) = 0: Next: LaserFired = 1: NextBeam = 1
MovesLeft = MovesLeft - 1: Color 0, 1: Locate 40, 103: Print "Moves Left:"; MovesLeft;
' Get Laser Location and Beam Direction
For Z = 1 To 9
For Y = 1 To 9
If BoardPlayer(Z, Y) = Player And BoardPiece(Z, Y) = 7 Then LaserRow = Z: LaserColumn = Y: BeamDirection(1) = BoardRotate(Z, Y): Direction = BeamDirection(1)
Next
Next
' Fire Laser Beam Exiting Laser
X1 = BoardX(LaserRow, LaserColumn): X2 = BoardY(LaserRow, LaserColumn): V = Point(X1, X2): PSet (X1, X2), V: Draw Rotate$(BeamDirection(1)) + LaserBeam$(1)
' Set Beam 1 Row and Column to Laser's Location
Row(1) = LaserRow: Column(1) = LaserColumn
CheckBeams:
For Z = 1 To 3
BeamRow = Row(Z): BeamColumn = Column(Z): If BeamDirection(Z) > 0 Then Beam = Z: On BeamDirection(Z) GOSUB BeamLeft, BeamDown, BeamRight, BeamUp
Next
' Check If All Beams Has Ended
If BeamDirection(1) + BeamDirection(2) + BeamDirection(3) > 0 Then GoTo CheckBeams
' Redraw Beam from Laser if Laser is Destroyed
If Hit(1) = 4 Or Hit(2) = 4 Or Hit(3) = 4 Then X1 = BoardX(LaserRow, LaserColumn): X2 = BoardY(LaserRow, LaserColumn): V = Point(X1, X2): PSet (X1, X2), V: Draw Rotate$(Direction) + LaserBeam$(1)
' Display List of Destroyed Pieces
Color 0, 1: Locate 16, 101: Print " Pieces Destroyed ";: X = 16: HitTotal = 0
' Display Destroyed Pieces
For Z = 1 To 3
HitTotal = HitTotal + Hit(Z): If Hit(Z) > 0 Then X = X + 2: Locate X, 98: Print Hit$(Hit(Z));
Next
' Display "N O N E" If No Pieces Were Destroyed
If HitTotal = 0 Then X = X + 2: Locate X, 97: Print Hit$(0);
X = X + 2: Locate X, 98: Print "Press ENTER to Continue";
GetENTER1: A$ = UCase$(InKey$): If A$ = "" Then GoTo GetENTER1
If Asc(A$) <> 13 Then GoTo GetENTER1
For Z = 16 To 24 Step 2: Locate Z, 98: Print " ";: Next
' Delete Destroyed From Memory
BoardPlayer(DrestroyRow, DestroyColumn) = 0: BoardPiece(DestroyRow, DestroyColumn) = 0: BoardRotate(DestroyRow, DrestroyColumn) = 0
' Remove Laser Beams and Destroyed Pieces From Board
GoSub UpdateBoard
'Check If King(s) Been Destroyed
For Z = 1 To 3
If Hit(Z) = 1 Or Hit(Z) = 2 Then Winner = Winner + Hit(Z)
Next
If Winner > 0 Then GoTo Winner
GoTo EndTurn
BeamLeft:
If BeamColumn - 1 >= 1 Then
BeamColumn = BeamColumn - 1: BeamX = BoardX(BeamRow, BeamColumn): BeamY = BoardY(BeamRow, BeamColumn): StartColor = Point(BeamX, BeamY)
BoardPlayer = BoardPlayer(BeamRow, BeamColumn): BoardPiece = BoardPiece(BeamRow, BeamColumn): BoardRotate = BoardRotate(BeamRow, BeamColumn)
If BoardPlayer = 0 Or BoardPiece = 6 Or (BoardPiece = 2 And BoardRotate = 1) Then BeamDraw = 2: BeamRotate = 1 ' Beam Pass Straight Through
If (BoardPiece = 1 And BoardRotate = 1) Or (BoardPiece = 5 And BoardRotate = 2) Then BeamDirection(Beam) = 4: BeamDraw = 5: BeamRotate = 1 ' Deflect Up off Triangle Mirror
If BoardPiece = 3 And BoardRotate = 2 Then BeamDirection(Beam) = 4: BeamDraw = 6: BeamRotate = 1 ' Deflect Up off Diagnol Mirror
If (BoardPiece = 1 And BoardRotate = 4) Or (BoardPiece = 5 And BoardRotate = 4) Then BeamDirection(Beam) = 2: BeamDraw = 5: BeamRotate = 4 ' Deflect Down off Triangle Mirror
If BoardPiece = 3 And BoardRotate = 1 Then BeamDirection(Beam) = 2: BeamDraw = 6: BeamRotate = 4 ' Deflect Down off Diagnol Mirror
If BoardPiece = 5 And BoardRotate = 1 Then BeamDirection(Beam) = 2: NextBeam = NextBeam + 1: BeamDirection(NextBeam) = 4: Row(NextBeam) = BeamRow: Column(NextBeam) = BeamColumn: BeamDraw = 7: BeamRotate = 1 ' Deflect From Beam Splitter
If BoardPiece = 1 And (BoardRotate = 2 Or BoardRotate = 3) Then Hit(Beam) = 9: BeamDraw = 3: BeamRotate = 1 ' Hit Side of Triagle Mirror
If BoardPiece = 4 And BoardRotate > 1 Then Hit(Beam) = 7: BeamDraw = 3: BeamRotate = 1 ' Hit Side or Back of Block
If BoardPiece = 5 And BoardRotate = 3 Then Hit(Beam) = 5: BeamDraw = 3: BeamRotate = 1 ' Hit Back of Beam Spliter
If BoardPiece = 7 And BoardRotate = 1 Then Hit(Beam) = 3: BeamDraw = 3: BeamRotate = 1 ' Hit Back of Laser
If BoardPiece = 7 And (BoardRotate = 2 Or BoardRotate = 4) Then Hit(Beam) = 3: BeamDraw = 8: BeamRotate = 1 ' Hit Side of Laser
If BoardPiece = 7 And BoardRotate = 3 Then Hit(Beam) = 3: BeamDraw = 1: BeamRotate = 3 ' Hit Front of Laser
If BoardPiece = 2 And BoardRotate = 2 Then Hit(Beam) = 4: BeamDraw = 9: BeamRotate = 1 ' Hit Your Own Laser from Straight Mirror
If BoardPiece = 4 And BoardRotate = 1 Then Hit(Beam) = 4: BeamDraw = 3: BeamRotate = 1 ' Hit Your Own Laser from Block Mirror
If BoardPiece = 8 Then Hit(Beam) = 1: BeamDraw = 4: BeamRotate = 1 ' Hit King
If Hit(Beam) > 0 Then
BeamDirection(Beam) = 0
If Hit(Beam) = 4 Then
' Destroy Own Laser, Hit From Straight Mirror
BoardPlayer(LaserRow, LaserColumn) = 0: BoardPiece(LaserRow, LaserColumn) = 0: BoardRotate(LaserRow, LaserColumn) = 0
DestroyRow = LaserRow: DestroyColumn = LaserColumn
Else
' Destroy Anyother Piece
DestroyRow = BeamRow: DestroyColumn = BeamColumn
If BoardPlayer(BeamRow, BeamColumn) = Player Then Hit(Beam) = Hit(Beam) + 1
End If
' Draw Cursor Around Destroyed Pieces
X1 = BoardX(DestroyRow, DestroyColumn): X2 = BoardY(DestroyRow, DestroyColumn)
V = Point(X1, X2): PSet (X1, X2), V: Draw "C8" + Cursor$
' End Beam Path
BeamDirection(Beam) = 0
End If
' Draw Beam
X1 = BoardX(BeamRow, BeamColumn): X2 = BoardY(BeamRow, BeamColumn)
V = Point(X1, X2): PSet (X1, X2), V: Draw Rotate$(BeamRotate) + LaserBeam$(BeamDraw)
' Set Last Location of Beam
Row(Beam) = BeamRow: Column(Beam) = BeamColumn
Else
BeamDirection(Beam) = 0
End If
Return
BeamDown:
If BeamRow + 1 <= 9 Then
BeamRow = BeamRow + 1: BeamX = BoardX(BeamRow, BeamColumn): BeamY = BoardY(BeamRow, BeamColumn): StartColor = Point(BeamX, BeamY)
BoardPlayer = BoardPlayer(BeamRow, BeamColumn): BoardPiece = BoardPiece(BeamRow, BeamColumn): BoardRotate = BoardRotate(BeamRow, BeamColumn)
If BoardPlayer = 0 Or BoardPiece = 6 Or (BoardPiece = 2 And BoardRotate = 2) Then BeamDraw = 2: BeamRotate = 2 ' Beam Pass Straight Through
If (BoardPiece = 1 And BoardRotate = 1) Or (BoardPiece = 5 And BoardRotate = 1) Then BeamDirection(Beam) = 3: BeamDraw = 5: BeamRotate = 1 ' Deflect Right off Triangle Mirror
If BoardPiece = 3 And BoardRotate = 2 Then BeamDirection(Beam) = 3: BeamDraw = 6: BeamRotate = 1 ' Deflect Right off Diagnol Mirror
If (BoardPiece = 1 And BoardRotate = 2) Or (BoardPiece = 5 And BoardRotate = 3) Then BeamDirection(Beam) = 1: BeamDraw = 5: BeamRotate = 2 ' Deflect Left off Triangle Mirror
If BoardPiece = 3 And BoardRotate = 1 Then BeamDirection(Beam) = 1: BeamDraw = 6: BeamRotate = 2 ' Deflect Left off Diagnol Mirror
If BoardPiece = 5 And BoardRotate = 2 Then BeamDirection(Beam) = 3: NextBeam = NextBeam + 1: BeamDirection(NextBeam) = 1: Row(NextBeam) = BeamRow: Column(NextBeam) = BeamColumn: BeamDraw = 7: BeamRotate = 2 ' Deflect From Beam Splitter
If BoardPiece = 1 And (BoardRotate = 3 Or BoardRotate = 4) Then Hit(Beam) = 9: BeamDraw = 3: BeamRotate = 2 ' Hit Side of Triagle Mirror
If BoardPiece = 4 And (BoardRotate = 1 Or BoardRotate > 2) Then Hit(Beam) = 7: BeamDraw = 3: BeamRotate = 2 ' Hit Side or Back of Block
If BoardPiece = 5 And BoardRotate = 4 Then Hit(Beam) = 5: BeamDraw = 3: BeamRotate = 2 ' Hit Back of Beam Spliter
If BoardPiece = 7 And BoardRotate = 2 Then Hit(Beam) = 3: BeamDraw = 3: BeamRotate = 2 ' Hit Back of Laser
If BoardPiece = 7 And (BoardRotate = 1 Or BoardRotate = 3) Then Hit(Beam) = 3: BeamDraw = 8: BeamRotate = 2 ' Hit Side of Laser
If BoardPiece = 7 And BoardRotate = 4 Then Hit(Beam) = 3: BeamDraw = 1: BeamRotate = 4 ' Hit Front of Laser
If BoardPiece = 2 And BoardRotate = 1 Then Hit(Beam) = 4: BeamDraw = 9: BeamRotate = 2 ' Hit Your Own Laser from Straight Mirror
If BoardPiece = 4 And BoardRotate = 2 Then Hit(Beam) = 4: BeamDraw = 3: BeamRotate = 2 ' Hit Your Own Laser from Block Mirror
If BoardPiece = 8 Then Hit(Beam) = 1: BeamDraw = 4: BeamRotate = 2 ' Hit King
If Hit(Beam) > 0 Then
BeamDirection(Beam) = 0
If Hit(Beam) = 4 Then
' Destroy Own Laser, Hit From Straight Mirror
BoardPlayer(LaserRow, LaserColumn) = 0: BoardPiece(LaserRow, LaserColumn) = 0: BoardRotate(LaserRow, LaserColumn) = 0
DestroyRow = LaserRow: DestroyColumn = LaserColumn
Else
' Destroy Anyother Piece
DestroyRow = BeamRow: DestroyColumn = BeamColumn
If BoardPlayer = Player Then Hit(Beam) = Hit(Beam) + 1
End If
' Draw Cursor Around Destroyed Pieces
X1 = BoardX(DestroyRow, DestroyColumn): X2 = BoardY(DestroyRow, DestroyColumn)
V = Point(X1, X2): PSet (X1, X2), V: Draw "C8" + Cursor$
' End Beam Path
BeamDirection(Beam) = 0
End If
' Draw Beam
X1 = BoardX(BeamRow, BeamColumn): X2 = BoardY(BeamRow, BeamColumn)
V = Point(X1, X2): PSet (X1, X2), V: Draw Rotate$(BeamRotate) + LaserBeam$(BeamDraw)
' Set Last Location of Beam
Row(Beam) = BeamRow: Column(Beam) = BeamColumn
Else
BeamDirection(Beam) = 0
End If
Return
BeamRight:
If BeamColumn + 1 <= 9 Then
BeamColumn = BeamColumn + 1: BeamX = BoardX(BeamRow, BeamColumn): BeamY = BoardY(BeamRow, BeamColumn): StartColor = Point(BeamX, BeamY)
BoardPlayer = BoardPlayer(BeamRow, BeamColumn): BoardPiece = BoardPiece(BeamRow, BeamColumn): BoardRotate = BoardRotate(BeamRow, BeamColumn)
If BoardPlayer = 0 Or BoardPiece = 6 Or (BoardPiece = 2 And BoardRotate = 1) Then BeamDraw = 2: BeamRotate = 1 ' Beam Pass Straight Through
If (BoardPiece = 1 And BoardRotate = 2) Or (BoardPiece = 5 And BoardRotate = 2) Then BeamDirection(Beam) = 4: BeamDraw = 5: BeamRotate = 2 ' Deflect Up off Triangle Mirror
If BoardPiece = 3 And BoardRotate = 1 Then BeamDirection(Beam) = 4: BeamDraw = 6: BeamRotate = 2 ' Deflect Up off Diagnol Mirror
If (BoardPiece = 1 And BoardRotate = 3) Or (BoardPiece = 5 And BoardRotate = 4) Then BeamDirection(Beam) = 2: BeamDraw = 5: BeamRotate = 3 ' Deflect Down off Triangle Mirror
If BoardPiece = 3 And BoardRotate = 2 Then BeamDirection(Beam) = 2: BeamDraw = 6: BeamRotate = 3 ' Deflect Down off Diagnol Mirror
If BoardPiece = 5 And BoardRotate = 3 Then BeamDirection(Beam) = 4: NextBeam = NextBeam + 1: BeamDirection(NextBeam) = 2: Row(NextBeam) = BeamRow: Column(NextBeam) = BeamColumn: BeamDraw = 7: BeamRotate = 3 ' Deflect From Beam Splitter
If BoardPiece = 1 And (BoardRotate = 1 Or BoardRotate = 4) Then Hit(Beam) = 9: BeamDraw = 3: BeamRotate = 3 ' Hit Side of Triagle Mirror
If BoardPiece = 4 And (BoardRotate < 3 Or BoardRotate = 4) Then Hit(Beam) = 7: BeamDraw = 3: BeamRotate = 3 ' Hit Side or Back of Block
If BoardPiece = 5 And BoardRotate = 1 Then Hit(Beam) = 5: BeamDraw = 3: BeamRotate = 3 ' Hit Back of Beam Spliter
If BoardPiece = 7 And BoardRotate = 3 Then Hit(Beam) = 3: BeamDraw = 3: BeamRotate = 3 ' Hit Back of Laser
If BoardPiece = 7 And (BoardRotate = 2 Or BoardRotate = 4) Then Hit(Beam) = 3: BeamDraw = 8: BeamRotate = 3 ' Hit Side of Laser
If BoardPiece = 7 And BoardRotate = 1 Then Hit(Beam) = 3: BeamDraw = 1: BeamRotate = 1 ' Hit Front of Laser
If BoardPiece = 2 And BoardRotate = 2 Then Hit(Beam) = 4: BeamDraw = 9: BeamRotate = 3 ' Hit Your Own Laser from Straight Mirror
If BoardPiece = 4 And BoardRotate = 3 Then Hit(Beam) = 4: BeamDraw = 3: BeamRotate = 3 ' Hit Your Own Laser from Block Mirror
If BoardPiece = 8 Then Hit(Beam) = 1: BeamDraw = 4: BeamRotate = 4 ' Hit King
If Hit(Beam) > 0 Then
BeamDirection(Beam) = 0
If Hit(Beam) = 4 Then
' Destroy Own Laser, Hit From Straight Mirror
BoardPlayer(LaserRow, LaserColumn) = 0: BoardPiece(LaserRow, LaserColumn) = 0: BoardRotate(LaserRow, LaserColumn) = 0
DestroyRow = LaserRow: DestroyColumn = LaserColumn
Else
' Destroy Anyother Piece
DestroyRow = BeamRow: DestroyColumn = BeamColumn
If BoardPlayer = Player Then Hit(Beam) = Hit(Beam) + 1
End If
' Draw Cursor Around Destroyed Pieces
X1 = BoardX(DestroyRow, DestroyColumn): X2 = BoardY(DestroyRow, DestroyColumn)
V = Point(X1, X2): PSet (X1, X2), V: Draw "C8" + Cursor$
' End Beam Path
BeamDirection(Beam) = 0
End If
' Draw Beam
X1 = BoardX(BeamRow, BeamColumn): X2 = BoardY(BeamRow, BeamColumn)
V = Point(X1, X2): PSet (X1, X2), V: Draw Rotate$(BeamRotate) + LaserBeam$(BeamDraw)
' Set Last Location of Beam
Row(Beam) = BeamRow: Column(Beam) = BeamColumn
Else
BeamDirection(Beam) = 0
End If
Return
BeamUp:
If BeamRow - 1 >= 1 Then
BeamRow = BeamRow - 1: BeamX = BoardX(BeamRow, BeamColumn): BeamY = BoardY(BeamRow, BeamColumn): StartColor = Point(BeamX, BeamY)
BoardPlayer = BoardPlayer(BeamRow, BeamColumn): BoardPiece = BoardPiece(BeamRow, BeamColumn): BoardRotate = BoardRotate(BeamRow, BeamColumn)
If BoardPlayer = 0 Or BoardPiece = 6 Or (BoardPiece = 2 And BoardRotate = 2) Then BeamDraw = 2: BeamRotate = 2 ' Beam Pass Straight Through
If (BoardPiece = 1 And BoardRotate = 3) Or (BoardPiece = 5 And BoardRotate = 3) Then BeamDirection(Beam) = 1: BeamDraw = 5: BeamRotate = 3 ' Deflect Left off Triangle Mirror
If BoardPiece = 3 And BoardRotate = 2 Then BeamDirection(Beam) = 1: BeamDraw = 6: BeamRotate = 3 ' Deflect Left off Diagnol Mirror
If (BoardPiece = 1 And BoardRotate = 4) Or (BoardPiece = 5 And BoardRotate = 1) Then BeamDirection(Beam) = 3: BeamDraw = 5: BeamRotate = 4 ' Deflect Right off Triangle Mirror
If BoardPiece = 3 And BoardRotate = 1 Then BeamDirection(Beam) = 3: BeamDraw = 6: BeamRotate = 4 ' Deflect Right off Diagnol Mirror
If BoardPiece = 5 And BoardRotate = 4 Then BeamDirection(Beam) = 1: NextBeam = NextBeam + 1: BeamDirection(NextBeam) = 3: Row(NextBeam) = BeamRow: Column(NextBeam) = BeamColumn: BeamDraw = 7: BeamRotate = 4 ' Deflect From Beam Splitter
If BoardPiece = 1 And (BoardRotate = 1 Or BoardRotate = 2) Then Hit(Beam) = 9: BeamDraw = 3: BeamRotate = 4 ' Hit Side of Triagle Mirror
If BoardPiece = 4 And BoardRotate < 4 Then Hit(Beam) = 7: BeamDraw = 3: BeamRotate = 4 ' Hit Side or Back of Block
If BoardPiece = 5 And BoardRotate = 2 Then Hit(Beam) = 5: BeamDraw = 3: BeamRotate = 4 ' Hit Back of Beam Spliter
If BoardPiece = 7 And BoardRotate = 4 Then Hit(Beam) = 3: BeamDraw = 3: BeamRotate = 4 ' Hit Back of Laser
If BoardPiece = 7 And (BoardRotate = 1 Or BoardRotate(BeamRow, BeamColumn) = 3) Then Hit(Beam) = 3: BeamDraw = 8: BeamRotate = 4 ' Hit Side of Laser
If BoardPiece = 7 And BoardRotate = 2 Then Hit(Beam) = 3: BeamDraw = 1: BeamRotate = 2 ' Hit Front of Laser
If BoardPiece = 2 And BoardRotate = 1 Then Hit(Beam) = 4: BeamDraw = 9: BeamRotate = 4 ' Hit Your Own Laser from Straight Mirror
If BoardPiece = 4 And BoardRotate = 4 Then Hit(Beam) = 4: BeamDraw = 3: BeamRotate = 4 ' Hit Your Own Laser from Block Mirror
If BoardPiece = 8 Then Hit(Beam) = 1: BeamDraw = 4: BeamRotate = 4 ' Hit King
If Hit(Beam) > 0 Then
BeamDirection(Beam) = 0
If Hit(Beam) = 4 Then
' Destroy Own Laser, Hit From Straight Mirror
BoardPlayer(LaserRow, LaserColumn) = 0: BoardPiece(LaserRow, LaserColumn) = 0: BoardRotate(LaserRow, LaserColumn) = 0
DestroyRow = LaserRow: DestroyColumn = LaserColumn
Else
' Destroy Anyother Piece
DestroyRow = BeamRow: DestroyColumn = BeamColumn
If BoardPlayer(BeamRow, BeamColumn) = Player Then Hit(Beam) = Hit(Beam) + 1
End If
' Draw Cursor Around Destroyed Pieces
X1 = BoardX(DestroyRow, DestroyColumn): X2 = BoardY(DestroyRow, DestroyColumn)
V = Point(X1, X2): PSet (X1, X2), V: Draw "C8" + Cursor$
' End Beam Path
BeamDirection(Beam) = 0
End If
' Draw Beam
X1 = BoardX(BeamRow, BeamColumn): X2 = BoardY(BeamRow, BeamColumn)
V = Point(X1, X2): PSet (X1, X2), V: Draw Rotate$(BeamRotate) + LaserBeam$(BeamDraw)
' Set Last Location of Beam
Row(Beam) = BeamRow: Column(Beam) = BeamColumn
Else
BeamDirection(Beam) = 0
End If
Return
Winner:
If Winner = 1 Then Winner = Player Else If Winner = 2 Then Winner = Opponent
If Winner = 1 Then T1 = 1: T2 = 1: T3 = 1: T4 = 2 Else If Winner = 2 Then T1 = 2: T2 = 2: T3 = 2: T4 = 1 Else T1 = 1: T2 = 1: T3 = 2: T4 = 2
If Winner < 3 Then
X1 = 766: X2 = 613: X3 = T1: X4 = 7: X5 = 4: X6 = 1: GoSub DrawPiece
X1 = 765: X2 = 182: X3 = T2: X4 = 1: X5 = 4: X6 = 1: GoSub DrawPiece
X1 = 975: X2 = 182: X3 = T3: X4 = 1: X5 = 3: X6 = 1: GoSub DrawPiece
X1 = 974: X2 = 613: X3 = T4: X4 = 8: X5 = 2: X6 = 1: GoSub DrawPiece
PSet (765, 596), 5: Draw "TA0U416R210D401L2U399L206D414L2BE1P5,5"
Color 0, 1: Locate 14, 106: Print "Player"; Winner;
Color 0, 1: Locate 16, 101: Print " W I N N E R ! ";
Color 0, 1: Locate 18, 101: Print " King Destroyed ";
Else
Line (730, 150)-(1010, 650), 1, BF
Color 0, 1: Locate 12, 101: Print " T I E G A M E "
Color 0, 1: Locate 14, 96: Print "Both Kings where Destroyed!";
Color 0, 1: Locate 16, 101: Print "Play Another Game?";
Color 0, 1: Locate 17, 101: Print " Yes or No ";
X1 = 766: X2 = 605: X3 = 1: X4 = 8: X5 = 4: X6 = 1: GoSub DrawPiece
X1 = 765: X2 = 315: X3 = 1: X4 = 1: X5 = 4: X6 = 1: GoSub DrawPiece
X1 = 975: X2 = 315: X3 = 2: X4 = 1: X5 = 3: X6 = 1: GoSub DrawPiece
X1 = 974: X2 = 605: X3 = 2: X4 = 8: X5 = 2: X6 = 1: GoSub DrawPiece
X1 = 869: X2 = 315: X3 = Player: X4 = 5: X5 = 4: X6 = 1: GoSub DrawPiece
X1 = 869: X2 = 455: X3 = Player: X4 = 7: X5 = 4: X6 = 1: GoSub DrawPiece
PSet (870, 438), 5: Draw "TA0U122R103D256R2U258L210D258R2U256R101D122R2BH1P5,5"
End If
AnotherGame:
YesNo: A$ = UCase$(InKey$): If A$ = "" Then GoTo YesNo
If A$ = "Y" Then Run
If A$ = "N" Then System
GoTo YesNo
'LOCATE 18, 98: PRINT Hit$(5);
X1 = BoardX(9, 3): X2 = BoardY(9, 3)
V = Point(X1, X2): PSet (X1, X2), V: Draw Rotate$(2) + LaserBeam$(6)
X1 = BoardX(8, 2): X2 = BoardY(8, 2)
V = Point(X1, X2): PSet (X1, X2), V: Draw Rotate$(4) + LaserBeam$(3)
X1 = BoardX(8, 3): X2 = BoardY(8, 3)
V = Point(X1, X2): PSet (X1, X2), V: Draw Rotate$(4) + LaserBeam$(3)
X1 = BoardX(9, 2): X2 = BoardY(9, 2)
V = Point(X1, X2): PSet (X1, X2), V: Draw Rotate$(1) + LaserBeam$(5)
|