remstart
Dark AI Tutorial
By Steve Vink for The Game Creators Ltd
remend

` The debug switch allows us to show waypoints manually.
` The automatic debug visibility is not appropriate,
` because of the different landscape heights.
` Switch the visibility off by setting cDEBUG to 1
#constant cDEBUG 1

` To store the positions of objects and entities efficiently,
` we will use a user defined type to hold the 3 coordinates.
Type tPos
	x as float
	y as float
	z as float
endtype


` Waypoint positions will be stored in an array for future reference
dim gWaypoints() as tPos

` Basic Setup
set window on
SYNC ON: SYNC RATE 60
autocam off
AI start


` Create a terrain for our demo
makeTerrain()


` *********************************************************************
` Add waypoints to the map, to mark out the relevant paths
createWaypoints()


` *********************************************************************
` Main Loop
do
	
	control camera using arrowkeys 0,2,1
	position camera camera position x(), get terrain ground height( 1, camera position x( ), camera position z( ) ) + 15,camera position z()
	center text screen width() / 2,screen height() - 100, "Use Arrow keys to move and Turn"
	update terrain
	text 5,5, str$(camera position x())
	text 5,25, str$(camera position z())
	sync
	
loop

end



		 