Sub Form1004_after()
Dim i as Integer
Do Until (SysEventAvailable()=1 And Flg=1) Or Flg3=1
For i=1 to 10
DrawBitmap Scrn(i),i*15-10,25
Next
DrawBitmap 1007,5,Yi*15+25
Lbl1021.Label="SCORE:" + Format(Score,"000000")
If ReStart=1 Then
DrawChars "Ready!",65,75
For i=1 to MyShip
DrawBitmap 1020,90+i*11,148
Next
DrawLine 5,147,155,147
Delay 1.5
ReStart=0
End If
FUEL=FUEL-1
DrawLine 5+FUEL,147,155,147,nsbInverted
Score=Score+1
If Yi<1 Or Yi>6 Or FUEL=0 Then
Call Crush
Redraw
End If
If Scrn(1)<1014 Then
If Scrn(1)-1007=Yi Then
Call Crush
Redraw
End If
End If
If Scrn(1)=1016 And Yi=6 Then
FUEL=FUEL+20
If FUEL>150 Then
FUEL=150
End If
DrawLine 5,147,5+FUEL,147
End If
For i=1 to 9
Scrn(i)=Scrn(i+1)
Next
If Flg=1 Then
Delay 0.15
End If
Flg2=Flg2-1
If Flg2=0 Then
Scrn(10)=1008+Int(rand()*9)
Flg2=5
Else
Scrn(10)=1014+Int(rand()*2)
End If
Yi=Yi+1
Flg=1
Loop
End Sub
Sub Crush()
Dim i as Integer
For i=0 to 10
DrawBitmap 1018,5,Yi*15+25
Delay 0.1
DrawBitmap 1019,5,Yi*15+25
Delay 0.1
Next
FillRectangle 90+MyShip*11,148,10,10,0,nsbInverted
MyShip=MyShip-1
If MyShip<0 Then
DrawChars "GAME OVER",55,75
Flg3=1
Else
Delay 1.5
Call Init_Screen
End If
End Sub
|