プログラムリスト
SYS/GAME7EXPAD
トップメニュー「SmileBASICでプログラムを作る」から、LOAD"SYS/GAME7EXPAD"↵
でプログラムが読み込まれます。キーボードの「EDIT」キーを押すと、このプログラムが自由に編集できます。
'
' GAME7EXPAD
' かくちょうスライドパッド を つかったゲーム
'
DIM TX[10],TY[10]
DIM TX1[10],TY1[10]
DIM TR[10],TR1[10]
XSCREEN 2
VISIBLE 1,1,1,1
DISPLAY 1
CLS
RESTORE @TXTDATA
FOR I=0 TO 99
READ A$
IF A$=="" THEN BREAK
FOR J=0 TO LEN(A$)-1
LOCATE 20-(LEN(A$)/2)+J,I
IF MID$(A$,J,1)=="" THEN COLOR 3 ELSE COLOR 15
PRINT MID$(A$,J,1)
NEXT
NEXT
@TXTDATA
DATA "かくちょうスライドパッド を つかったゲーム"
DATA " "
DATA " "
DATA " CATCH THE POTS"
DATA " "
DATA " "
DATA " "
DATA " "
DATA " "
DATA " "
DATA " "
DATA " ∴ ∴ "
DATA " ∵ ∵ "
DATA " "
DATA " "
DATA " "
DATA ""
DATA " "
DATA " "
DATA " "
DATA " "
DATA " "
DATA " "
DATA " "
DATA " "
DATA " "
DATA " "
DATA ""
DATA ""
DISPLAY 0
GCLS
CLS
GPRIO 1024
'
FOR Y=0 TO 239
FOR X=0 TO 399 STEP 2
C=RGB(0,Y,RND(64)+64*3)
GPSET X,Y,C
NEXT
NEXT
WHILE 1
TOUCH OUT STMM,SX,SY
IF STMM==0 THEN BREAK
VSYNC 1
WEND
'-----
@RETRY
BGMSTOP
CLS
WAIT 30
COLOR 15
A$="PUSH ANY BUTTON"
LOCATE 25-(LEN(A$)/2),15,-100
PRINT A$
'-----
WHILE 1
IF BUTTON() THEN BREAK
VSYNC 1
WEND
CLS
SPCLR
XON EXPAD
ZM=2
SPA=0
SPB=1
SPDEF 265 OUT U,V,W,H,X,Y,A
SPDEF 265,U,V,W,H,W/2,H/2,A 'POTS
SPDEF 289 OUT U,V,W,H,X,Y,A
SPDEF 4093,U,V,W,H,W/2,H/2,A 'LEFT HAND
SPDEF 289 OUT U,V,W,H,X,Y,A
SPDEF 4094,U,V,W,H,W/2,H/2,9 'RIGHT HAND
SPSET SPA,4093
SPROT SPA,90
SPSCALE SPA,ZM,ZM
SPSET SPB,4094
SPROT SPB,-90
SPSCALE SPB,ZM,ZM
'
LOGOSP=255
SPSET LOGOSP,4095:SPHIDE LOGOSP
SPOFS LOGOSP,340,24,-32:SPSHOW LOGOSP
FOR I=0 TO 8
SPN=2+I
C=265
SPSET SPN,C
SPOFS SPN,999,999
NEXT
'
TMAX=0
Z=-64
LIMIT=236
ZM2=2
HIT=24
OVR=0
TIM=0
MVX=90
BGMPLAY 34
'-----
WHILE 1
STICKEX OUT RX,RY
STICK OUT LX,LY
XA=LX*MVX+(200-MVX)
YA=-LY*60+(220-60)
XB=RX*MVX+(200+MVX)
YB=-RY*60+(220-60)
SPOFS SPA,XA,YA,Z
SPOFS SPB,XB,YB,Z
BTN=BUTTON()
FOR I=0 TO TMAX-1
IF TY[I]>LIMIT THEN CONTINUE
TX[I]=TX[I]+TX1[I]
TY[I]=TY[I]+TY1[I]
TY1[I]=TY1[I]+0.03
TR[I]=TR[I]+TR1[I]
IF TR[I]>360 THEN TR[I]=TR[I]-360
IF TR[I]<0 THEN TR[I]=TR[I]+360
SPN=2+I
SPOFS SPN,TX[I],TY[I],Z+(I*8)
SPROT SPN,TR[I]
SPCOLOR SPN,RGB(255,255,255)
DX=ABS(TX[I]-XA)
DY=ABS(TY[I]-YA)
IF DX<HIT AND DY<HIT THEN
TX1[I]=ABS(RND(4)/6)+0.5
TY1[I]=-ABS(TY1[I])
TR1[I]=(RND(9)-4)/4
TR[I]=TR[I]+180
BEEP 8,-2000
SPANIM SPA,"R",1,135,-10,45,-10,90
ENDIF
DX=ABS(TX[I]-XB)
DY=ABS(TY[I]-YB)
IF DX<HIT AND DY<HIT THEN
TX1[I]=-ABS(RND(4)/6)-0.5
TY1[I]=-ABS(TY1[I])
TR[I]=TR[I]+180
TR1[I]=(RND(9)-4)/4
BEEP 8,-2000
SPANIM SPB,"R",1,-135,-10,-45,-10,-90
ENDIF
IF TY[I]>LIMIT THEN
BEEP 13
BEEP 105,-2000
SPROT SPN,0
C=265+2048
SPANIM SPN,"I",1,C,15,C+1,15,C+2,1
IF OVR<=0 THEN
OVR=1
LOCATE 15,15,-100
PRINT "G A M E O V E R !!"
BGMSTOP
ENDIF
ENDIF
IF TY[I]<24 THEN TY[I]=24:TY1[I]=0
IF TX[I]<24 THEN TX1[I]=ABS(TX1[I])
IF TX[I]>(400-24) THEN TX1[I]=-ABS(TX1[I])
NEXT
IF OVR==0 THEN INC TIM
LOCATE 20,1,-100
PRINT "SCORE ";TIM
IF (TIM MOD 300)==0 THEN
TMAX=TMAX+1
IF TMAX>9 THEN
TMAX=9
ELSE
I=TMAX-1
SPN=2+I
SPSCALE SPN,ZM2,ZM2
TX[I]=200
TY[I]=32
TY1[I]=0
TX1[I]=(RND(4)/3)-(RND(4)/3)
TR[I]=0
TR1[I]=(RND(9)-4)/4
ENDIF
ENDIF
IF OVR THEN INC OVR
IF OVR>100 THEN BREAK
VSYNC 1
WEND
WAIT 60
XOFF EXPAD
GOTO @RETRY
END