Sub title
state = "title"
Shapes.ShowShape(title_p)
mcnt = 0
While state = "title"
mcnt = mcnt +1
If mcnt > 60 Then
' メッセージを点滅させる
If Math.Remainder(mcnt,60) < 40 Then
Shapes.ShowShape(msg)
Else
Shapes.HideShape(msg)
EndIf
' クリックされたらタイトルから抜ける
If Mouse.IsLeftButtonDown = "true" Then
state = "start"
EndIf
EndIf
Program.Delay(1000/60)
EndWhile
Shapes.HideShape(title_p)
Shapes.HideShape(msg)
EndSub
Sub OnMouseMove
If state <> "play" Then
Goto endOnMouse
EndIf
px = GraphicsWindow.MouseX
' py = GraphicsWindow.MouseY
' 自機が右端に隠れないようにする
If (GraphicsWindow.Width -pw) < px Then
px = GraphicsWindow.Width -pw
EndIf
Shapes.Move(player,px,py)
endOnMouse:
EndSub
Sub gameover
Shapes.HideShape(player) ' 自機を隠す
' 爆発演出
For i=0 To 7
tmp = Shapes.AddImage(exp[i])
Shapes.Move(tmp,px-30,py-25)
Program.Delay(1000/20)
Shapes.Remove(tmp)
EndFor
mcnt = 0 ' メッセージ用カウンタ
While state = "gameover"
mcnt = mcnt +1
If mcnt = 30 Then
Shapes.ShowShape(gover)
EndIf
If mcnt > 120 Then
' メッセージを点滅させる
If Math.Remainder(mcnt,60) < 40 Then
Shapes.ShowShape(msg)
Else
Shapes.HideShape(msg)
EndIf
If Mouse.IsLeftButtonDown = "true" Then
state = "title"
EndIf
EndIf