I can do upto like 2000 :P
EDIT: This one has a few changes (be sure to change the resolution)
SuperStrict
Framework brl.standardio
Import BaH.random
Import brl.glmax2d
SetGraphicsDriver(GLMax2DDriver())
Graphics 1440, 900
Type TEnemy
Global _list:TList = New(TList)
Field xpos:Float, ypos:Float, osize:Float, ospeed:Float, angle:Float, pulse_angle:Float, pdir:Int
Method New()
_list.AddLast(Self)
End Method
Method Create:TEnemy(_xpos:Float, _ypos:Float, _osize:Float, _ospeed:Float, _pulse_angle:Float)
xpos = _xpos; ypos = _ypos
osize = _osize; ospeed = _ospeed
pulse_angle = _pulse_angle
Return Self
End Method
Method Draw(to_x:Float, to_y:Float, chase:Int, chasetype:Int)
Local angle:Float
If chasetype = True
angle = AngleFromPoints(xpos, ypos, to_x, to_y)
Else If chasetype = False
angle = AngleFromPoints(to_x, to_y, xpos, ypos)
End If
Local xspeed:Float = Cos(angle), yspeed:Float = Sin(angle)
Local csize:Float = (osize + Sin(pulse_angle)) / 10.0
If chase = True
xpos:+xspeed * ospeed
ypos:+yspeed * ospeed
End If
'SetColor(255, 255, 255)
'DrawOvalUnfilled(xpos - csize, ypos - csize, csize * 2, csize * 2)
'DrawOval(xpos - csize, ypos - csize, csize * 2, csize * 2)
SetColor(xspeed * pulse_angle, yspeed * pulse_angle, (yspeed - xspeed) * pulse_angle)
'SetColor 25, 25, 25
SetRotation(angle)
SetScale(csize, csize)
DrawImage(gradient, xpos, ypos)
'SetColor(255, 0, 0)
'DrawLine(xpos, ypos, xpos + (xspeed * csize), ypos + (yspeed * csize))
If pulse_angle >= 360.0 Or pulse_angle <= 180.0 Then pdir:~ 1
If pdir = True Then pulse_angle:+5.0 Else pulse_angle:-5.0
End Method
Function DrawAll(to_x:Float, to_y:Float, chase:Int, chasetype:Int)
For Local nme:TEnemy = EachIn _list
nme.Draw(to_x, to_y, chase, chasetype)
Next
End Function
End Type
Local intensity:Float = 6.5
For Local i:Int = 1 To 2000
New(TEnemy).Create(Rnd(0, GraphicsWidth()), Rnd(0, GraphicsHeight()), Rnd(2.5, intensity), Rnd(3.5, 6.0), Rnd(180.0, 360.0))
Next
AutoMidHandle(True)
'Draw a blobby energy field with squared falloff
Local size:Int = 256
For Local Radius:Float = 1 Until size Step 0.5
Local Energy:Float = (Radius * Radius) / 1024.0
SetColor(Energy, Energy, Energy)
'DrawOval(Radius / 2.0, Radius / 2.0, size - Radius, size - Radius)
DrawRect(Radius / 2.0, Radius / 2.0, size - Radius, size - Radius)
Next
'Turn it into an image/texture
Global gradient:TImage = CreateImage(size, size)
GrabImage(gradient, 0, 0)
SetBlend(LIGHTBLEND)
Local antial:Int, chasetype:Int
While Not KeyHit(KEY_ESCAPE) And Not AppTerminate()
Cls()
'If antial > 2 Then Cls() ; antial = 0
If KeyHit(KEY_SPACE) Then chasetype:~ 1
TEnemy.DrawAll(MouseX(), MouseY(), MouseDown(MOUSE_LEFT), chasetype)
'antial:+1
Flip() ; Delay(10)
Wend
Function AngleFromPoints:Float(x1:Float, y1:Float, x2:Float, y2:Float)
Return ATan2((y2 - y1), (x2 - x1)) + 180
End Function
Function DrawOvalUnfilled(x0:Float, y0:Float, w:Float, h:Float)
Local xr:Float = w *.5
Local yr:Float = h *.5
Local segs:Int = Abs(xr) + Abs(yr)
segs = Max(segs, 12) & ~3
x0:+xr
y0:+yr
Local px:Float, py:Float
'glBegin(GL_LINES)
For Local i:Int = 0 Until segs + 1
Local th:Float = i * 360 / segs
Local X:Float = x0 + Cos(th) * xr
Local Y:Float = y0 - Sin(th) * yr
If i > 0
DrawLine px, py, X, Y
End If
px = X
py = Y
Next
'glEnd()
End Function
rem
xspeed = Cos(angle)
yspeed = Sin(angle)
If MouseDown(MOUSE_LEFT)
pointx = pointx + xspeed * 8.0
pointy = pointy + yspeed * 8.0
End If
mz = defsize + Sin(pulse_angle) * 10
If KeyHit(KEY_SPACE) Then chase:~1
If chase = True
angle = AngleFromPoints(pointx, pointy, MouseX(), MouseY())
Else If chase = False
angle = AngleFromPoints(MouseX(), MouseY(), pointx, pointy)
End If
DrawOvalUnfilled(pointx - mz, pointy - mz, mz * 2, mz * 2)
'DrawOvalUnfilled(MouseX() - mz, MouseY() - mz, mz * 2, mz * 2)
'SetColor(0, 0, 255)
'DrawLine(pointx, pointy, MouseX(), MouseY())
SetColor(255, 0, 0)
DrawLine(pointx, pointy, pointx + (xspeed * mz), pointy + (yspeed * mz))
SetColor(255, 255, 255)
'DrawText("Angle: " + angle, 0, 0)
If pulse_angle >= 360 Then pulse_angle = 0
pulse_angle:+15
end rem