I had copied this code from some where, and saved it, it has a paddle and a moveing ball, but the paddle dose not move,..I don't know who wrote the original code,..I added a few lines,..and tried changeing some things,..but still could not get the paddle moveing.
REM
DEFINT A-Z
DIM Ball%(540)
DIM Mask%(540)
DIM Background%(540)
DIM PaddleBak%(102) '10x40
SCREEN 12
_FULLSCREEN
PRINT "HELLO WORLD"
PLAY "ageba"
PRINT "Can anyone tell me who owns this code ? "
CX = 20: CY = 10: oldcx = CX: oldcy = CY
px = 420: py = 440: oldpx = px: oldpy = py
GOSUB MakBall
GOSUB MakMask
CLS
GOSUB MakBackground
Horizontal = 4: Vertical = 4
DO
Past! = TIMER
GOSUB GetKey
PUT (oldpx, oldpy), PaddleBak%(0), PSET
PUT (oldcx, oldcy), Background%(0), PSET
GET (px, py)-(px + 39, py + 9), PaddleBak%(0)
GET (CX, CY)-(CX + 19, CY + 19), Background%(0)
LINE (px, py)-(px + 39, py + 9), 3, BF
PUT (CX, CY), Mask%(0), AND 'draw ball
PUT (CX, CY), Ball%(0), XOR 'draw ball
GOSUB Movement
GOSUB Boundary
WHILE Past! = TIMER: WEND
LOOP WHILE INKEY$ <> CHR$(27)
SYSTEM
'-GOSUBS
GetKey:
a% = 0
a$ = INKEY$
a$ = RIGHT$(a$, 1)
IF LEN(a$) > 0 THEN a% = ASC(a$)
RETURN
MakBall:
CIRCLE (9, 9), 9, 12
PAINT (9, 9), 2, 12
GET (0, 0)-(19, 19), Ball%(0)
RETURN
MakMask:
FOR x = 0 TO 19
FOR y = 0 TO 19
z = POINT(x, y)
IF z <> 0 THEN PSET (x, y), 0 ELSE PSET (x, y), 8
NEXT y
NEXT x
GET (0, 0)-(19, 19), Mask%(0)
RETURN
MakBackground:
FOR x = 0 TO 699 STEP 3
LINE (x, 10)-(x - 50, 470), 7
NEXT x
GET (CX, CY)-(CX + 19, CY + 19), Background%(0)
GET (px, py)-(px + 39, py + 9), PaddleBak%(0)
RETURN
Movement:
oldcx = CX: oldcy = CY
CX = CX + Horizontal
CY = CY + Vertical
oldpx = px: oldpy = py
IF a% = 75 THEN
px = px - 4
IF px < 10 THEN px = 10
END IF
IF a% = 77 THEN
px = px + 4
IF px > 590 THEN px = 590
END IF
RETURN
Boundary:
IF CX <= 10 THEN
CX = 10
Horizontal = -Horizontal
END IF
IF CX >= 620 THEN
CX = 620
Horizontal = -Horizontal
END IF
IF CY <= 10 THEN
CY = 10
Vertical = -Vertical
END IF
IF CY >= 420 THEN
IF CX >= px AND CX <= px + 39 THEN
CY = 420
Vertical = -Vertical
END IF
END IF
IF CY > 460 THEN END
RETURN