Ok, here is the relevant code (a little messy):
set display mode 1280,1024,32
color backdrop 0
autocam off
hide mouse
set camera range .1,200000
rem load map
gosub LoadMap
position camera -300,35,-30
rem beginning of main game loop
do
rem print info
set cursor 0,0
print screen fps()
print camera position x()
print camera position y()
print camera position z()
ax#=curveangle(ax#+mousemovey(),ax#,5)
ay#=curveangle(ay#+mousemovex(),ay#,5)
rotate camera ax#,ay#,0
if mouseclick()=1 then move camera 1
AI Update
if returnkey()=1 then AI Debug Show Paths 36
rem syncronize
sync
rem end of main game loop
loop
rem load map
LoadMap:
rem creates the AI system
AI Start
rem sets the global radius, all entities will assumed to be this size
AI Set Radius .00000000001
rem castle map
make light 1
set spot light 1,0,90
set light range 1,100
color light 1,rgb(255,255,255)
rem load map
load object "media1.x",9999
scale object 9999,25,25,25
set object light 9999,1
load object "media1_lm.x",10000
scale object 10000,25,25,25
set object light 10000,1
ghost object on 10000
AI Add Static Obstacle 9999
AI Make Path 1
rem specify the points we want in our patrol in the order to visit them.
rem After the last point the first point becomes the next destination.
AI Path Add Point 1,-440,0
AI Path Add Point 1,-250,-30
rem make 4 entities
for i =57 to 57
make object cone i,5
xrotate object i,90
fix object pivot i
position object i,-250,25,-30
color object i,rgb(255,0,0)
rem add them to the enemy team and set their speed (in units per second)
AI Add Enemy i,1
AI Set Entity Speed i,2
AI Entity Assign Patrol Path i,1
next i
AI Complete Obstacles
return
And the level object and textures are attatched.
Thanks a million.
Uncle Sam
Nvidia Geforce 7950GT 512MB PCIEx, 2.66 GHZ Pentium 4 proccessor, 1GB RAM
Need particles? Click
here!