'Brick Smasher was created by Ken G. with some help from people at the QB64.org forum, thanks!
'This game is freeware.
start:
paddles = 10
x = 300: y = 450
points = 0
level = 0
snd = 950
snd = snd - 10
PRINT " You start with 10 Paddles." PRINT " Use the mouse wheel to move." PRINT " Press Esc anytime to quit." INPUT " Press Enter Key to start!", st$
'This starts a new level.
levels:
DIM brick
(500), xx
(500), yy
(500) brick(tt) = 0
xx(tt) = 0
yy(tt) = 0
b = 0
bb = 0
t = 0
skip2:
level = level + 1
titl$ = "Brick Smasher"
titl2$ = "Score:" + score$
titl3$ = "Paddles:" + paddles$
titl4$ = "Level:" + level$
setup:
'This loads all the bricks into memory.
col = col + 500
b = b + 1
xx(b) = xx
yy(b) = yy
LINE (xx
, yy
)-(xx
+ 50, yy
+ 5), _RGB32(col
, col2
, col3
), BF
go:
up = 1
down = 0
right = 0
left = 0
LINE (oldx
, oldy
)-(oldx
+ 80, oldy
+ 10), _RGB32(0, 0, 0), BF
bx = x + 20
by = y - 6
oldbx = bx
oldby = by
oldx = x
oldy = y
LINE (x
, y
)-(x
+ 80, y
+ 10), _RGB32(255, 0, 0), BF
mouseWheel = 0
go2:
oldwheel = mouseWheel
'Right
moveright = 1
moveleft = 0
nomove = 0
oldx = x
x = x + 20
LINE (oldx
, oldy
)-(oldx
+ 80, oldy
+ 10), _RGB32(0, 0, 0), BF
LINE (x
, y
)-(x
+ 80, y
+ 10), _RGB32(255, 0, 0), BF
'Left
moveleft = 1
moveright = 0
nomove = 0
oldx = x
x = x - 20
LINE (oldx
, oldy
)-(oldx
+ 80, oldy
+ 10), _RGB32(0, 0, 0), BF
LINE (x
, y
)-(x
+ 80, y
+ 10), _RGB32(255, 0, 0), BF
nomove = 1
oldbx = bx
oldby = by
bx = bx + upx
by = by - 2
oldbx = bx
oldby = by
bx = bx + downx
by = by + 2
oldbx = bx
oldby = by
bx = bx + 2
oldbx = bx
oldby = by
bx = bx - 2
'Check the paddle.
up = 1
down = 0
right = 1
left = 0
nomove = 0
moveleft = 0
nomove = 0
downx = (oldwheel + mouseWheel) / 2
olddownx = downx
left = 1
right = 0
nomove = 0
moveright = 0
nomove = 0
downx = (oldwheel - mouseWheel) / 2
olddownx = downx
downx = -(olddownx)
moveright = 0
moveleft = 0
oldbx = bx
oldby = by
bx = bx - upx
by = by - 7
LINE (x
, y
)-(x
+ 80, y
+ 10), _RGB32(255, 0, 0), BF
'Check Bricks
bb = bb + 1
IF bx
> xx
(bb
) - 1 AND bx
< xx
(bb
) + 51 AND by
> yy
(bb
) - 1 AND by
< yy
(bb
) + 6 THEN points = points + 10
LINE (xx
(bb
), yy
(bb
))-(xx
(bb
) + 50, yy
(bb
) + 5), _RGB32(0, 0, 0), BF
brick(bb) = 1
up = 0:
down = 1
down = 0
up = 1
skip:
titl$ = "Brick Smasher"
titl2$ = "Score:" + score$
titl3$ = "Paddles:" + paddles$
titl4$ = "Level:" + level$
t = t + 1
nextbrick:
bb = 0
right = 1
left = 0
oldbx = bx
oldby = by
bx = bx + rightx
olddownx = downx
bx = bx + downx
by = by - 2
bx = bx + upx
left = 1
right = 0
oldbx = bx
oldby = by
bx = bx - leftx
olddownx = downx
bx = bx + downx
by = by - 2
bx = bx + upx
up = 1
down = 0
oldbx = bx
oldby = by
paddles = paddles - 1
titl$ = "Brick Smasher"
titl2$ = "Score:" + score$
titl3$ = "Paddles:" + paddles$
titl4$ = "Level:" + level$
INPUT "Play Again? (Yes/No)", ag$
IF ag$
= "y" OR ag$
= "Y" OR ag$
= "Yes" OR ag$
= "YES" OR ag$
= "yes" OR ag$
= "yES" OR ag$
= "yeS" THEN GOTO start:
down = 1
up = 0
olddownx = downx
oldbx = bx
oldby = by
bx = bx + downx
by = by + downx