Well I changed the code after what you said but now it says object does not exist..
[Code]
;Probewars with Types v2
Type Probe
Field X%,Y%
Field health%
Field r,g,b
End Type
For NR = 1 To 30
P.Probe = New Probe
;Possition
P\X = Rnd(0,800): P\Y = Rnd(0,600)
;Colors
P\r = Rnd(0,255): P\g = Rnd(0,255): P\b = Rnd(0,255)
Next
Graphics 800,600,16,0 ;Window
SetBuffer BackBuffer()
SeedRnd = MilliSecs()
While Not KeyDown(1)
;Cls
;Move the Probe randomly
For P.Probe = Each Probe
P\X = P\X + Rnd( -1,1 )
P\Y = P\Y + Rnd( -1,1 )
Color P\r,P\g,P\b ;add color
Plot P\X,P\Y
Next
;Check if any Probe overlaps any other probe
For P.Probe = Each Probe
For P2.Probe = Each Probe
If P\X = P2\X And P\Y = P2\Y
Delete P.Probe
EndIf
Next
Next
Flip
Wend
[/Code]
[Code]
;Probewars with Types v2
Type Probe
Field X%,Y%
Field health%
Field r,g,b
End Type
For NR = 1 To 30
P.Probe = New Probe
;Possition
P\X = Rnd(0,800): P\Y = Rnd(0,600)
;Colors
P\r = Rnd(0,255): P\g = Rnd(0,255): P\b = Rnd(0,255)
Next
Graphics 800,600,16,0 ;Window
SetBuffer BackBuffer()
SeedRnd = MilliSecs()
While Not KeyDown(1)
;Cls
;Move the Probe randomly
For P.Probe = Each Probe
P\X = P\X + Rnd( -1,1 )
P\Y = P\Y + Rnd( -1,1 )
Color P\r,P\g,P\b ;add color
Plot P\X,P\Y
Next
;Check if any Probe overlaps any other probe
For P.Probe = Each Probe
For P2.Probe = Each Probe
If P\X = P2\X And P\Y = P2\Y
Delete P.Probe
EndIf
Next
Next
Flip
Wend
[/Code]