04-08-2003, 04:04 AM
I have a program with two paddles...
You push "z" and one goes down
You push "m" and the other goes down
But how do you make it so you can push both "z" and "m" at the same time and both paddles move at the same time?
I know it's kind of messy and all but... can you not make comments... Please just tell me how to push the buttons at the same time and have the paddles move at the same time?[/quote]
You push "z" and one goes down
You push "m" and the other goes down
But how do you make it so you can push both "z" and "m" at the same time and both paddles move at the same time?
Code:
CLS
SCREEN 13
y = 1
y2 = 11
y3 = 1
y4 = 11
DO
LINE (5, y)-(7, y2), , BF
LINE (105, y3)-(107, y4), , BF
GOSUB delay
LINE (5, y)-(7, y2), 0, BF
LINE (105, y3)-(107, y4), 0, BF
IF y2 >= 200 THEN
y2 = 200: y = 189
END IF
IF y <= 1 THEN
y = 1: y2 = 11
END IF
IF y4 >= 200 THEN
y3 = 200: y4 = 189
END IF
IF y3 <= 1 THEN
y3 = 1: y4 = 11
END IF
GOSUB adsb
LOOP
delay:
FOR delay% = 1 TO 7
FOR delay2% = 1 TO 32000: NEXT delay2%
NEXT delay%
RETURN
adsb:
SELECT CASE INKEY$
CASE "a"
y = y - 7: y2 = y2 - 7
CASE "z"
y = y + 7: y2 = y2 + 7
CASE "k"
y3 = y3 - 7: y4 = y4 - 7
CASE "m"
y3 = y3 + 7: y4 = y4 + 7
CASE "q"
END
CASE "p"
GOSUB Pause
END SELECT
RETURN
Pause:
DO
LOCATE 12, 15
c = c + 1
IF c = 15 THEN c = 0
COLOR c
PRINT "Pause"
SELECT CASE INKEY$
CASE "q"
COLOR 15
END
CASE "p"
LOCATE 12, 15: COLOR 0: PRINT "Pause": COLOR 15
RETURN
END SELECT
LOOP
RETURN
I know it's kind of messy and all but... can you not make comments... Please just tell me how to push the buttons at the same time and have the paddles move at the same time?[/quote]