rem generate our basic map
sync rate 60
hide mouse
remstart THIS ANIMATION DERPS BRICKS
TitleScreen:
cls
PLAY ANIMATION 1,0,10,10,20,20
do
wait 10000
gosub MainSection `if it stopped setup the game
loop
remend
REM *** LOAD SECTION ***
REM ANIMATIONS
`load animation "animations/intro.wmv",1
REM IMAGES
load image "images/landshot.jpg", 2
load image "images/grass_texture_2.jpg", 3
load image "images/bush.jpg", 5
REM SOUNDS AND MUSIC
REM LOADING THE TITLE SCREEN
MainSection:
texture backdrop 2
setupmap(3,1524,1524,1)
rem setup our camera
xrotate Camera 60
scrollspeed = 12
camx# = 512
camz# = 512
zoom = 500 `how far above the camera is
Set camera range 1,3000
`load object "models/horse/3dm-horse.max",1
`position object 1,100,100,100
do
if mousex() > screen width() - 10
camx = camx + scrollspeed
else
if mousex() <= 10 then camx = camx - scrollspeed
endif
if mousey() > screen height() - 10
camz = camz - scrollspeed
else
if mousey() <= 10 then camz = camz + scrollspeed
endif
if zoom >= 250:
if keystate(17)=1 then zoom = zoom - 8
endif
if zoom <= 750:
if keystate(31)=1 then zoom = zoom + 8
endif
`ink rgb(255,255,255),rgb(255,255,255)
`box 1, 200, 1024, 0
load bitmap "images/HUD_Box.jpg",0
position camera camx, zoom, camz
sync
loop
function setupmap(texture,width,height,id):
map_width = width
map_height = height
make matrix id,map_width,map_height,100,100
prepare matrix texture id,texture,1,1 `texture our tiles
`for i=0 to 32:
`set matrix height id,0,32,200
REM HILL GENERATION
numofhills = 25 rem how many hills to make
height = 175
for num=0 to numofhills:
z = 10 + rnd(75)
x = 10 + rnd(75)
random = rnd(160)
height = 40 + random
set matrix height id,x,z,height
for nz=z to z+10:
for nx=x to x+5:
if height >= 2:
set matrix height id,nx,nz,height
height = height - 2
endif
next nx
next nz
height = 0
for nz=z-10 to z:
for nx=x to x+5:
if height <= 40+random:
set matrix height id,nx,nz,height
height = height + 2
endif
next nx
next nz
next num
remstart
for x=x to 32:
for i=0 to 8:
set matrix height id,i,x,height
height = height - 1
next i
next x
for x=18 to 22:
for i=0 to 8:
set matrix height id,i,x,height
height = height + 1
next i
next x
for x=22 to 25:
for i=0 to 8:
set matrix height id,i,x,height
next i
next x
set matrix height id,4,22,100
set matrix height id,4,21,100
set matrix height id,5,22,200
set matrix height id,5,21,200
for i=0 to 32:
set matrix height id,i,32,200
next i
`next i
remend
update matrix 1
endfunction