Microsoft Small Basic

Program Listing: CSH800
GraphicsWindow.Title="ボールキャッチゲーム 2011.12.6"
GraphicsWindow.DrawText(0,0,"5球のボールをラケットの中心でキャッチ(100点満点)")
GraphicsWindow.DrawText(50,50,"パーフェクト(100点)を目指せ!")
'
raketto=Shapes.AddRectangle(50,20)
ball=Shapes.AddEllipse(20,20)
score=0
'
For i=1 To 5
Sound.PlayMusic("o7c8")
x=Math.GetRandomNumber(GraphicsWindow.width-20)
y=0
'
While y Shapes.Move(ball,x,y)
Shapes.Move(raketto,GraphicsWindow.MouseX,GraphicsWindow.Height-20)
y=y+1
Program.Delay(2)
EndWhile
'
If(x>=Shapes.GetLeft(raketto) And x+20<=Shapes.GetLeft(raketto)+50) then
score=score+20
Sound.PlayClick()
Program.Delay(300)
Else
Program.Delay(300)
EndIf
EndFor
'
GraphicsWindow.DrawText(100,100,"score : "+score)
If score=100 Then
Sound.PlayChimes()
GraphicsWindow.DrawText(150,150,"*** イェー(^_^)v、パーフェクト!! ***")
Else
GraphicsWindow.DrawText(150,150,"*** 残念! ***")
EndIf
'