Oh hey! Here is the unenRitchied AI Missile Guided version called AIM - AI Missile.bas
That draws a sort of Hippie message overall when you run it.
Code: (Select All)
W = 800: H = 600
Screen _NewImage(800, 600, 32)
Randomize Timer
Color &HFFFFFFFF, &HFF6666DD
Cls
a:
a = Rnd * W: b = 0: c = Rnd * 6 - 3: d = Rnd * 3 + 3: x = 400: y = H: lastx = x: lasty = y: lasta = a: lastb = b: l = 5
l = l * 10
Do
_Title "AIM-AI Missile Defense - Hits:" + Str$(t) + ", Misses:" + Str$(m)
a = a + c: b = b + d: ang = _Atan2(b - y, a - x)
x = x + 7 * Cos(ang): y = y + 7 * Sin(ang)
If x < 0 Or y < 0 Or a < 0 Or b < 0 Or x > W Or a > W Or b > H Then
If b > H Or x < 0 Or y < 0 Or x > W Then m = m + 1
GoTo a:
End If
If ((x - a) ^ 2 + (y - b) ^ 2) ^ .5 < 10 Then
For r = 1 To 20 Step 4
Circle ((x + a) / 2, (y + b) / 2), r, &HFFFF0000
_Limit 10
Next
t = t + 1: GoTo a:
Else
Line (x, y)-(lastx, lasty), &HFF006600: Line (a, b)-(lasta, lastb), &HFFDDDDFF
lastx = x: lasty = y: lasta = a: lastb = b
End If
_Limit l
Loop Until t = 50
Sleep
That draws a sort of Hippie message overall when you run it.
b = b + ...