verdammt, doch ein kleiner Fehler, ich hoffe diesmal passts (sonst geht runter nicht und man könnte nicht verlieren). Also hier Version 1.001
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Declare Function GetTickCount Lib "kernel32.dll" () As Long
Private Function GK(k As Long) As Boolean: GK = (GetAsyncKeyState(k) And &H8000): End Function
Private Sub Form_Load(): Dim b(9, 9), l, i, j, py, ex, ey, c, t1, t2, fy(10), fx(10), fe(10), fc, s
l = 1: py = 1800: ex = 2500: ey = 400: s = 0: For i = 0 To 9: For j = 0 To 9:
b(i, j) = Round(Rnd * l + 1, 0): Next: Next: Me.Show: Me.BackColor = RGB(0, 0, 255): Do: DoEvents:
Me.Caption = "Level :" & l & " Score :" & s: t1 = GetTickCount: With Me: .AutoRedraw = 1: .Cls: m = 0:
Me.Line (0, py - 50)-(200, py): Me.Line (0, py + 50)-(200, py): For i = 0 To 9: For j = 0 To 9:
c = b(i, j) * 20: m = m + c: Me.Line (ex + i * 200, ey + j * 200)-(ex + i * 200 + 199, ey + j * 200 + 199), _
RGB(c, c * 0.5, 255 - c), BF: Next: Next: If ex < 1000 Then End:
If m = 0 Then
l = l + 1: ex = 2500: For i = 0 To 9: For j = 0 To 9: b(i, j) = Round(Rnd * l + 1, 0): Next: Next
If l = 12 Then MsgBox "Thanks for playing. You have won!", , "": End:
End If: .AutoRedraw = 0: End With: If GK(27) Then End:
If GK(38) And py > 100 Then py = py - 45
If GK(40) And py < 3600 Then py = py + 45
If GK(32) And fc < 10 And py >= ey And py <= ey + 2000 Then
n = Round((py - ey + 100) / 200, 0) - 1: For i = 0 To 9:
If b(i, n) > 0 Then Exit For
Next:
If i < 10 Then
b(i, n) = b(i, n) - 1: fe(fc) = ex: s = s + 1
Else: fe(fc) = 10 ^ 4: End If: fy(fc) = py: fx(fc) = 200: fc = fc + 1: End If: t2 = GetTickCount
ex = ex - (t2 - t1) / 20: For i = 0 To fc - 1: If fx(i) < fe(i) Then fx(i) = fx(i) + (t2 - t1) * 10 Else fc = fc - 1
Me.Line (fx(i), fy(i))-(fx(i) + 100, fy(i)): Next: Loop: End Sub
..oO?*Kondome sch?tzen nicht vor Geschlechtsverkehr*?Oo..
[stell dir vor es g?be Demokratie, und niemand geht hin.]
Visual Basic auf USB-Stick
Beitrag wurde zuletzt am 16.10.08 um 14:27:54 editiert. |