Microsoft Small Basic

Program Listing: XJR622
GraphicsWindow.Title="ラケットゲームver0.03 2011.12.24 MerryChristmas!"
GraphicsWindow.BackgroundColor="#001100"
GraphicsWindow.FontSize=18
'
score=0 '@
hiscore=0'@
wait=7'@
kihonten=10'@
bairitu=0'@
gw=GraphicsWindow.Width
gh=GraphicsWindow.Height
'
Hajimari:
scorekaunto()
wait=wait-1
bairitu=bairitu+1'@
GraphicsWindow.Clear()
GraphicsWindow.BrushColor="Gold"
raketto=Shapes.AddRectangle(60,12)
ball=Shapes.AddEllipse(16,16)
GraphicsWindow.MouseMove=OnMouseMove
'
x=Math.GetRandomNumber(gw-16)
y=0
deltaX=1
deltaY=1
tenjyou=0
tenjyouatumi=gh/10
'wait=5 '@
'
Loop:
x=x+deltaX
y=y+deltaY
'
If tenjyou>=gh-50 Then
Sound.PlayChime()'@
Goto Hajimari
EndIf
'
If(x>gw-16 Or x<=0) Then
deltaX=-deltaX
EndIf
If(y<=tenjyou) Then
deltaY=-deltaY
EndIf
'
rakettoX=Shapes.GetLeft(raketto)
If(y=gh-28 And x>=rakettoX-12 And x<=rakettoX+56) Then
deltaY=-deltaY
tenjyouRakka()
'
score=score+bairitu*kihonten'@
If score>=hiscore Then
hiscore=score
EndIf
ScoreKaunto()'@
Sound.PlayClick()
EndIf
'
Shapes.Move(ball,x,y)
Program.Delay(wait)
'
If(y Goto Loop
EndIf
'
GameOverGamen()
Sound.PlayChimesAndWait()'@
Program.Delay(2000)
'
score=0'@
bairitu=0'@
wait=7
Goto Hajimari
'''''''''' Sub '''''''''''''''''''''''''''''''''''''''''''''''
Sub OnMouseMove
rakettoX=GraphicsWindow.MouseX
Shapes.Move(raketto,rakettoX-60,gh-12)
EndSub
'
Sub TenjyouRakka
GraphicsWindow.BrushColor="Orange"
tenjyou=tenjyou+tenjyouatumi
GraphicsWindow.FillRectangle(0,0,gw,tenjyou)
EndSub
'
Sub ScoreKaunto'@
GraphicsWindow.FontSize=15
GraphicsWindow.BrushColor="#001100"'@
GraphicsWindow.FillRectangle(gw-200,gh-50,170,20)'@
GraphicsWindow.BrushColor="Red"'@
GraphicsWindow.DrawText(gw-200,gh-50,"Score:"+score)'@

GraphicsWindow.BrushColor="Orange"'@
GraphicsWindow.DrawText(gw-120,gh-50,"Hi-score:"+hiscore)'@
EndSub'@
'
Sub GameOverGamen'@
GraphicsWindow.Clear()'@
GraphicsWindow.DrawText(50,30,"Game Over!")'@
GraphicsWindow.DrawText(gw/2-40,60,"Your Score:"+score)'@
GraphicsWindow.BrushColor="White"'@
GraphicsWindow.DrawText(gw/2-30,90,"Hi-Score:"+hiscore)'@
EndSub'@