Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' IchigoJam JoyStick Sample Revised
- ' Requirment :
- ' Connections: IN1 = SW
- ' IN2 = VR-X
- ' BTN = VR-Y
- ' Rev: Line 20 "UART0" has been added.
- 10 'ジョイスティック サンプル
- 20 UART0:CLS
- 30 FOR I=0 to 31
- 40 LC I,23:?CHR$(145);
- 50 NEXT
- 70 X=15:Y=21:M=0:D=0:J=0:K=0:P=0
- 80 IF D=0 E=RND(31):F=2:D=1
- 90 LC 0,0:?"SCORE=";P;
- 100 GOSUB 200
- 110 GOSUB 300
- 120 GOTO 80
- 200 IF M=0 AND IN(1)=0 J=X: K=Y-1:M=1:BEEP
- 210 A=ANA(0)-512
- 220 LCX,Y:?CHR$(32);:X=X-(A<-50)+(A>50)
- 224 IF X>31 X=X-1
- 225 IF X<0 X=X+1
- 226 LCX,Y:?CHR$(240);
- 230 IF M=1 LCJ,K:?CHR$(242);
- 240 LCE,F:?CHR$(241);
- 250 IF M=1 LCJ,K:?CHR$(32);:K=K-1:LCJ,K:?CHR$(242);
- 260 'IF D=1 LCE,F:?CHR$(241);
- 270 RETURN
- 300 IF K=F AND E=J D=0:P=P+10:BEEP:LC E,F:?CHR$(244);:WAIT20:LCE,F:?" ";:M=0
- 310 IF M=1 AND K=1 LCJ,K:?CHR$(32);:M=0
- 320 RETURN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement