When I run this code I only get one monster (M) on the screen but I was expecting 10. I have looked through it line by line and ripped it apart but I cannot seem to find the problem. If anyone can help then thank you.
start:
cls
sync on
sync rate 60
hide mouse
set text opaque
max=9
dim oldxpos2(max)
dim oldypos2(max)
dim xpos2(max)
dim ypos2(max)
for t=0 to max
randomize timer()
xpos2(t)=rnd(640)
ypos2(t)=rnd(480)
next t
xpos=30
ypos=30
do
oldxpos=xpos
oldypos=ypos
for t=0 to max
oldxpos2(t)=xpos2(t)
oldypos2(t)=ypos2(t)
next t
if upkey()=1 then ypos=ypos-2
if downkey()=1 then ypos=ypos+2
if leftkey()=1 then xpos=xpos-2
if rightkey()=1 then xpos=xpos+2
for t=1 to max
if sqrt((xpos-xpos2(t))^2+(ypos-ypos2(t))^2)<10
goto start
endif
if xpos<xpos2(t)
xpos2(t)=xpos2(t)-1
else
xpos2(t)=xpos2(t)+1
endif
if ypos<ypos2(t)
ypos2(t)=ypos2(t)-1
else
ypos2(t)=ypos2(t)+1
endif
remend
text oldxpos2(t),oldypos2(t)," "
text xpos2(t),ypos2(t),"M "
next t
text oldxpos,oldypos," "
text xpos,ypos,"O "
sync
loop
I am using DBC
The happenings of tommorow are behind us now