1
0
mirror of https://github.com/mbirth/gwbasic.git synced 2024-12-25 12:04:08 +00:00

Added JOYSTICK.BAS and JOYTEST.BAS.

This commit is contained in:
Markus Birth 1995-12-14 19:14:12 +01:00
parent 0dda8ad584
commit 6f62011a47
Signed by: mbirth
GPG Key ID: A9928D7A098C3A9A
2 changed files with 49 additions and 0 deletions

34
JOYSTICK/JOYSTICK.BAS Normal file
View File

@ -0,0 +1,34 @@
10 CLS
20 REM Bildaufbau
30 COLOR 12
40 LOCATE 1,33:PRINT"JOYSTICK-DATEN"
50 COLOR 14
60 LOCATE 3,1:PRINT"Joystick A:"
70 COLOR 15
80 PRINT"X-Axis"
90 PRINT"Y-Axis"
100 PRINT"Button A"
110 PRINT"Button B"
120 C=15
130 D=15
140 E=15
150 F=15
160 A=STICK(0):B=STICK(1)
170 REM Hauptteil
180 A(1)=STICK(0):A(2)=STICK(1):A(3)=STRIG(0):A(4)=STRIG(4)
190 B(1)=STICK(2):B(2)=STICK(3):B(3)=STRIG(2):B(4)=STRIG(6)
200 IF INKEY$=CHR$(27) THEN END
210 IF A(1)<A-10 THEN A$(1)="LEFT ":C=10:GOTO 240
220 IF A(1)>A+10 THEN A$(1)="RIGHT":C=10:GOTO 240
230 A$(1)=" ":C=15
240 IF A(2)<B-10 THEN A$(2)="UP ":D=10:GOTO 270
250 IF A(2)>B+10 THEN A$(2)="DOWN":D=10:GOTO 270
260 A$(2)=" ":D=15
270 REM Anzeigen
280 LOCATE 4,11:PRINT USING"###";A(1);:COLOR C:PRINT " ";A$(1):COLOR 15
290 LOCATE 5,11:PRINT USING"###";A(2);:COLOR D:PRINT " ";A$(2)
300 C=15:D=15
310 IF A(3)=-1 THEN COLOR 10:LOCATE 6,11:PRINT" ON" ELSE COLOR 12:LOCATE 6,11:PRINT"OFF"
320 IF A(4)=-1 THEN COLOR 10:LOCATE 7,11:PRINT" ON" ELSE COLOR 12:LOCATE 7,11:PRINT"OFF"
330 COLOR 15:GOTO 170


15
JOYSTICK/JOYTEST.BAS Normal file
View File

@ -0,0 +1,15 @@
10 CLS
20 PRINT"Joystick A"
30 PRINT USING"X ###";STICK(0)
40 PRINT USING"Y ###";STICK(1)
50 PRINT USING"Button A ##";STRIG(0)
60 PRINT USING"Button B ##";STRIG(4)
70 PRINT
80 PRINT"Joystick B"
90 PRINT USING"X ###";STICK(2)
100 PRINT USING"Y ###";STICK(3)
110 PRINT USING"Button A ##";STRIG(2)
120 PRINT USING"Button B ##";STRIG(6)
130 IF INKEY$=CHR$(27) THEN END
140 LOCATE 1,1:GOTO 20