CONST TRUE
= 1 ' Constants I put in every program CONST FALSE
= 0 ' Constant CONST t$
= "Û" ' I print out chr$(219) often so I use this constsant
WIDTH 80, 50 ' My programs are text based so I use this to get more lines _FULLSCREEN ' Pretty self explanatory. Maximize the window COLOR , 1:
CLS ' Make the entire screen blue
'I share most variables with all the subs and functions
DIM SHARED board
(1 TO 80, 1 TO 48, 1 TO 2) ' create the playing area. when I do y as 50 or 49 the screen fucks up. either a character (x, y, 1) or a color (x, y, 2)
'possibly change the paddle length to make the game easier or harder
crap:
PRINT "Error, error line"
beginning:
CALL InstallBackground
' Make the playing area blue with a read boarder CALL InstallPaddle
(TRUE
, paddleLeft
) ' Put the paddle in the playing area CALL InstallBall
(TRUE
, 40, 47) ' Put the ball in the playing area CALL PrintBoard
' Display the current board dontContinuouslyPrintScreen = TRUE
'use the left and right arrow keys
CALL InstallPaddle
(FALSE
, paddleLeft
) paddleLeft = paddleLeft - 1
IF paddleLeft
<= 1 THEN paddleLeft
= 2 CALL InstallPaddle
(TRUE
, paddleLeft
) dontContinuouslyPrintScreen = FALSE
IF dontContinuouslyPrintScreen
= FALSE
THEN dontContinuouslyPrintScreen = TRUE
SUB P
' I use this for debugging and put it in every program I write
FOR x
= 1 TO 80 ' make the default board board(x, y, 1) = 219 ' make the background on the playiung area blue
board(x, y, 2) = 1 ' make the board print out blocks
board(1, y, 1) = 219
board(1, y, 2) = 12
board(80, y, 1) = 219
board(80, y, 2) = 12
board(x, 1, 1) = 219
board(x, 1, 2) = 12
SUB PrintBoard
' Print out the current board to the screen LOCATE y
, x
' position the cursor COLOR board
(x
, y
, 2), 1 ' make the color of the cursor PRINT CHR$(board
(x
, y
, 1)) ' display the correct character code for that position
SUB InstallPaddle
(OnOrOff
, x
) ' put the paddle on the board FOR count
= x
TO x
+ paddleLength
' variable paddle length to make the game easier or harder IF OnOrOff
= TRUE
THEN ' put the paddle on the board board(count, 48, 1) = 219
board(count, 48, 2) = 15
ELSEIF OnOrOff
= FALSE
THEN ' remove the padde from the board board(count, 48, 1) = 219
board(count, 48, 2) = 1
SUB InstallBall
(OnOrOff
, x
, y
) IF OnOrOff
= TRUE
THEN ' put the ball on the board board(x, y, 1) = 254
board(x, y, 2) = 11
ELSEIF OnOrOff
= FALSE
THEN ' remove the ball from the board board(x, y, 1) = 219
board(x, y, 2) = 1