Microsoft Small Basic

Program Listing: VDX712
GraphicsWindow.Title="ラケットゲームver0.04 2011.12.26"
GraphicsWindow.BackgroundColor="#001a00"
GraphicsWindow.FontSize=18
'
score=0
hiscore=0
wait=7
kihonten=10
bairitu=0
stage=0
gw=GraphicsWindow.Width
gh=GraphicsWindow.Height
'
Hajimari:
scorekaunto()
wait=wait-1
bairitu=bairitu+1
stage=stage+1
GraphicsWindow.Clear()
GraphicsWindow.BrushColor="Gold"
raketto=Shapes.AddRectangle(60,12)
ball=Shapes.AddEllipse(16,16)
GraphicsWindow.DrawText(gw/2-30,gh-80,"Stage."+stage)
GraphicsWindow.MouseMove=OnMouseMove
'
x=Math.GetRandomNumber(gw-16)
y=0
deltaX=1
deltaY=1
tenjyou=0
tenjyouatumi=gh/10
'
Loop:
x=x+deltaX
y=y+deltaY
'
If tenjyou>=gh-50 Then
Sound.PlayChime()
Program.Delay(100)
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()
GraphicsWindow.FontSize=20
If stage=1 Then
Sound.PlayChimesAndWait()
GraphicsWindow.DrawText(gw/2-150,gh/2-20,"You are Baby!!!")
ElseIf stage=2 Then
Sound.PlayChimesAndWait()
GraphicsWindow.DrawText(gw/2-150,gh/2-20,"You are Beginner!!!")
ElseIf stage=3 Then
Sound.PlayBellRingAndWait()
GraphicsWindow.DrawText(gw/2-150,gh/2-20,"Good! But,You are Amateur!!!")
ElseIf stage=4 Then
Sound.PlayBellRingAndWait()
GraphicsWindow.DrawText(gw/2-150,gh/2-20,"Wow! Wonderful!!!")
ElseIf stage=5 Then
Sound.PlayChimesAndWait()
GraphicsWindow.DrawText(gw/2-150,gh/2-20,"You are Professional!!!")
ElseIf stage=6 Then
Sound.PlayChimesAndWait()
GraphicsWindow.DrawText(gw/2-150,gh/2-20,"Maybe,You are Genius!!!")
ElseIf stage=7 Then
Sound.PlayChimesAndWait()
GraphicsWindow.DrawText(gw/2-150,gh/2-20,"Unbelievable! You must be God!")
Endif
'
Program.Delay(3000)'@
'
score=0
bairitu=0
wait=7
stage=0
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="#001a00"
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