|
お手玉ゲーム
プチコン移植予定
←キーで左
↑キーで真ん中
→キーで右
3本あるラインの真ん中の線近くでタイミングよくボタンを押すと玉が勢いよく飛び出す。
玉を下に落さないようにタイミングよくボタンを押し続けよう。
玉の速度に上限を加えたり玉で敵を倒す演出を加えたり玉の数を増やすと面白いかも。
OPTION BASE 0
DIM bs(0 TO 2)
DIM ds(0 TO 2)
LET s=0
LET bs(0)=60
LET bs(1)=40
LET bs(2)=70
LET ds(0)=-0.25
LET ds(1)=-0.5
LET ds(2)=-0.7
SET WINDOW 0,250,-50,200
PRINT "タイミングよく←左↑真ん中→右"
DO
SET DRAW MODE HIDDEN
CLEAR
FOR i=0 TO 2
LET ds(i)=ds(i)+1.0/24.0
NEXT i
FOR i=0 TO 2
IF bs(i)>-50 THEN
LET bs(i)=bs(i)-ds(i)
DRAW disk WITH SCALE(10)*SHIFT(i*50+50,bs(i))
END IF
NEXT i
PLOT LINES: 0, 30 ; 400, 30
PLOT LINES: 0, 0 ; 400, 0
PLOT LINES: 0,-30 ; 400, -30
SET DRAW MODE EXPLICIT
IF s=0 THEN
LET s=1
LET sTime=TIME
DO
SET TEXT HEIGHT 40
PLOT TEXT ,AT 100, 100: STR$(CEIL(3-(TIME-sTime)))
SET TEXT HEIGHT 40
PLOT TEXT ,AT 100, 100: " "
FOR i=0 TO 2
DRAW disk WITH SCALE(10)*SHIFT(i*50+50,bs(i))
PLOT LINES: 0, 30 ; 400, 30
PLOT LINES: 0, 0 ; 400, 0
PLOT LINES: 0,-30 ; 400, -30
NEXT i
WAIT DELAY 1
CLEAR
LOOP WHILE (TIME-stime)<3
END IF
IF bs(0)<-49 OR bs(1)<-49 OR bs(2)<-49 THEN
EXIT DO
END IF
LET n=-1
LET enemyTime=TIME
DO
IF GetKeyState(37)<0 THEN
LET n=0
ELSeIF GetKeyState(38)<0 THEN
LET n=1
ELSeIF GetKeyState(39)<0 THEN
LET n=2
END IF
LOOP UNTIL (TIME-enemyTime)>(1.0/60.0)
IF n>-1 THEN
IF (bs(n)<30.0) AND (bs(n)>-30.0) AND (ds(n)>0.0) THEN
LET d=ABS(bs(n))/60.0-1.2
LET ds(n)=ds(n)*d
END IF
END IF
LOOP
END
|
|