run this have used the same values to put cubes and sphere where you have said the boundarys go, have number them in order they are placed.
CLS
SYNC ON : SYNC RATE 0 : AUTOCAM OFF
SET TEXT FONT "VERDANA" : SET TEXT SIZE 15
AI START
AI SET RADIUS 10
rem add cubes
autocam off
position camera 0,800,0
point camera 0,0,0
for i=1000 to 1008
make object cube i,15
next i
for i=1009 to 1016
make object sphere i,15
next i
rem =================================
REM DIMENSION
ENTITIES=2
DIM STARTPOINT(ENTITIES)
DIM ENDPOINT(ENTITIES)
DIM ENTITIESON(ENTITIES)
WIDTH#=600 `X
HEIGHT#=100 `Y
DEPTH#=600 `Z
BUSBAYWIDTH#=200
BUSBAYDEPTH#=100
REM FLOOR
MAKE OBJECT BOX ENTITIES+1,WIDTH#,2,DEPTH#
POSITION OBJECT ENTITIES+1,0,-1,0
COLOR OBJECT ENTITIES+1,RGB(255,255,255)
REM BUS BAY 1
MAKE OBJECT BOX ENTITIES+2,BUSBAYWIDTH#,2,BUSBAYDEPTH#
POSITION OBJECT ENTITIES+2,WIDTH#/2+BUSBAYWIDTH#/2,-1,-DEPTH#/4
COLOR OBJECT ENTITIES+2,RGB(255,255,255)
REM BUS BAY 2
MAKE OBJECT BOX ENTITIES+3,BUSBAYWIDTH#,2,BUSBAYDEPTH#
POSITION OBJECT ENTITIES+3,WIDTH#/2+BUSBAYWIDTH#/2,-1,DEPTH#/4
COLOR OBJECT ENTITIES+3,RGB(255,255,255)
REM MAKE BOUNDARY OBSTACLE, ENCLOSES THE SPACE TO KEEP THE ENTITY IN
REM ADD POINTS IN A ANTI-CLOCKWISE DIRECTION TO CREATE A BOUNDARY (USE CLOCKWISE TO CREATE AN OBSTACLE)
AI START NEW OBSTACLE
AI ADD OBSTACLE VERTEX -WIDTH#/2,-(DEPTH#/2+65)
AI ADD OBSTACLE VERTEX WIDTH#/2,-(DEPTH#/2+65)
AI ADD OBSTACLE VERTEX WIDTH#/2,-(DEPTH#/4+BUSBAYDEPTH#/2)
AI ADD OBSTACLE VERTEX WIDTH#/2+BUSBAYWIDTH#,-(DEPTH#/4+BUSBAYDEPTH#/2)
AI ADD OBSTACLE VERTEX WIDTH#/2+BUSBAYWIDTH#,(DEPTH#/4+BUSBAYDEPTH#/2)
AI ADD OBSTACLE VERTEX WIDTH#/2,(DEPTH#/4+BUSBAYDEPTH#/2)
AI ADD OBSTACLE VERTEX WIDTH#/2,(DEPTH#/2+65)
AI ADD OBSTACLE VERTEX -WIDTH#/2,(DEPTH#/2+65)
AI END NEW OBSTACLE 0,1
REM FINISH CREATING OUR BOUNDARY
REM CREATE OBSTACLE TO SEPARATE THE TWO BUS BAY
AI START NEW OBSTACLE
AI ADD OBSTACLE VERTEX WIDTH#/2,DEPTH#/4-BUSBAYDEPTH#/2
AI ADD OBSTACLE VERTEX WIDTH#/2+1,DEPTH#/4-BUSBAYDEPTH#/2
AI ADD OBSTACLE VERTEX WIDTH#/2+1,1
AI ADD OBSTACLE VERTEX WIDTH#/2+BUSBAYWIDTH#,1
AI ADD OBSTACLE VERTEX WIDTH#/2+BUSBAYWIDTH#,-1
AI ADD OBSTACLE VERTEX WIDTH#/2+1,-1
AI ADD OBSTACLE VERTEX WIDTH#/2+1,-(DEPTH#/4-BUSBAYDEPTH#/2)
AI ADD OBSTACLE VERTEX WIDTH#/2,-(DEPTH#/4-BUSBAYDEPTH#/2)
AI END NEW OBSTACLE 0,1
REM FINISH OBSTACLE TO SEPARATE THE TWO BUS BAY
AI COMPLETE OBSTACLES
FOR I=1 TO ENTITIES
REM REBORN THE ENTITIES
CREATEENTITIES(I)
REM RESET STARTING POINT
STARTPOINTF(I,WIDTH#,HEIGHT#,DEPTH#,BUSBAYWIDTH#,BUSBAYDEPTH#)
NEXT I
DO
rem placed cube to see where the egdes where
position object 1000, -WIDTH#/2,0,-(DEPTH#/2+65)
text object screen x(1000), object screen y(1000)-10,"cube 1"
position object 1001, WIDTH#/2,0,-(DEPTH#/2+65)
text object screen x(1001), object screen y(1001)-10,"cube 2"
position object 1002, WIDTH#/2,0,-(DEPTH#/4+BUSBAYDEPTH#/2)
text object screen x(1002), object screen y(1002)-10,"cube 3"
position object 1003, WIDTH#/2+BUSBAYWIDTH#,0,-(DEPTH#/4+BUSBAYDEPTH#/2)
text object screen x(1003), object screen y(1003)-10,"cube 4"
position object 1004, WIDTH#/2+BUSBAYWIDTH#,0,(DEPTH#/4+BUSBAYDEPTH#/2)
text object screen x(1004), object screen y(1004)-10,"cube 5"
position object 1005, WIDTH#/2,0,(DEPTH#/4+BUSBAYDEPTH#/2)
text object screen x(1005), object screen y(1005)-10,"cube 6"
position object 1006, WIDTH#/2,0,(DEPTH#/2+65)
text object screen x(1006), object screen y(1006)-10,"cube 7"
position object 1007, -WIDTH#/2,0,(DEPTH#/2+65)
text object screen x(1007), object screen y(1007)-10,"cube 8"
rem =================================================
rem ai two
position object 1009, WIDTH#/2,0,DEPTH#/4-BUSBAYDEPTH#/2
text object screen x(1009), object screen y(1009)+10,"sphere 1"
position object 1010, WIDTH#/2+1,0,DEPTH#/4-BUSBAYDEPTH#/2
text object screen x(1010), object screen y(1010)+10,"sphere 2"
position object 1011, WIDTH#/2+1,0,1
text object screen x(1011), object screen y(1011)+10,"sphere 3"
position object 1012, WIDTH#/2+BUSBAYWIDTH#,0,1
text object screen x(1012), object screen y(1012)+10,"sphere 4"
position object 1013, WIDTH#/2+BUSBAYWIDTH#,0,-1
text object screen x(1013), object screen y(1013)+10,"sphere 5"
position object 1014, WIDTH#/2+1,0,-1
text object screen x(1014), object screen y(1014)+10,"sphere 6"
position object 1015, WIDTH#/2+1,0,-(DEPTH#/4-BUSBAYDEPTH#/2)
text object screen x(1015), object screen y(1015)+10,"sphere 7"
position object 1016, WIDTH#/2,0,-(DEPTH#/4-BUSBAYDEPTH#/2)
text object screen x(1016), object screen y(1016)+10,"sphere 8"
REM RESET THE ENTITIES ON THE STAGE
ENTITIESON=0
FOR I= 1 TO ENTITIES
IF AI GET ENTITY Z (I)<(DEPTH#/2) AND AI GET ENTITY Z (I)>(-DEPTH#/2)
SHOW OBJECT I
ENTITIESON(I)=1
ENDIF
REM ARRIVE DESTINATION AND DELETE OBEJCT
REM DESTINATION IS 1
IF ENDPOINT(I)=1 REM AND AI ENTITY EXIST(I)=1
IF AI GET ENTITY Z (I)<(-DEPTH#/2)
`AI KILL ENTITY I
`DELETE OBJECT I
ENTITIESON(I)=0
ENDIF
ENDIF
REM DESTINATION IS 2
IF ENDPOINT(I)=2 REM AND AI ENTITY EXIST(I)=1
IF AI GET ENTITY Z (I)>(DEPTH#/2)
`AI KILL ENTITY I
`DELETE OBJECT I
ENTITIESON(I)=0
ENDIF
ENDIF
REM CALCULATE THE NUMBER OF ENTITIES ON THE STAGE
ENTITIESON= ENTITIESON+ENTITIESON(I)
NEXT I
SET CURSOR 0,0`DEPTH#/4
PRINT "NO. OF ENTITIES: ",ENTITIESON," / ",ENTITIES
PRINT ""
PRINT "CATEGORIES:- "
PRINT " ADULT - RED"
PRINT " ELDERLY - GREEN"
PRINT " DISABLE - BLUE"
PRINT "STARTPOINT(1): ",STARTPOINT(1)
PRINT "ENDPOINT(1): ", ENDPOINT(1)
PRINT "STARTPOINT(2): ",STARTPOINT(2)
PRINT "ENDPOINT(2): ", ENDPOINT(2)
PRINT "",WIDTH#/2+1
AI UPDATE
SYNC
LOOP
REM CREATE DIFF CATEGORIES OF ENTITIES
FUNCTION CREATEENTITIES(I)
CATEGORIES=0
REM NORMAL ADULT
IF CATEGORIES=0
MAKE OBJECT SPHERE I, 15
COLOR OBJECT I,RGB (255,0,0)
AI ADD ENEMY I
AI SET ENTITY SPEED I,25
ENDIF
SYNC
ENDFUNCTION
FUNCTION STARTPOINTF(I,WIDTH#,HEIGHT#,DEPTH#,BUSBAYWIDTH#,BUSBAYDEPTH#)
SYNC
STARTPOINT(I)= 1
IF STARTPOINT(I)=1
POSITION OBJECT I, RND(WIDTH#)-WIDTH#/2, 10,-(RND(40)+DEPTH#/2+25)
REM GO TO
ENDPOINT(I)=RND(1)+3
REM MAKE SURE NOT BACK TO SAME POSITION
WHILE ENDPOINT(I)=1
ENDPOINT(I)=RND(1)+3
ENDWHILE
ENDPOINTF(I,WIDTH#,HEIGHT#,DEPTH#,BUSBAYWIDTH#,BUSBAYDEPTH#)
ENDIF
SYNC
ENDFUNCTION
FUNCTION ENDPOINTF(I,WIDTH#,HEIGHT#,DEPTH#,BUSBAYWIDTH#,BUSBAYDEPTH#)
IF ENDPOINT(I)=3
AI ENTITY GO TO POSITION I,RND(BUSBAYWIDTH#*1/4)+WIDTH#/2+BUSBAYWIDTH#*3/4, -RND(DEPTH#/4-BUSBAYDEPTH#/2)
ENDIF
IF ENDPOINT(I)=4
AI ENTITY GO TO POSITION I,(RND(BUSBAYWIDTH#*1/4)+WIDTH#/2+BUSBAYWIDTH#*3/4), RND(DEPTH#/4-BUSBAYDEPTH#/2)
ENDIF
ENDFUNCTION
Dark Physics makes any hot drink go cold.