#############################
Entry for Challenge: seascape
#############################
hi all, I wanted to enter something into the seascape challenge ..
I have included on screen help for the hotkeys .. but in brief, keypad 1 opens one of the huts door, shift + keypad 1 opens the other. similarly closing the doors and opening/closing the windows keypad number for one, 'shift'+ keypad number for the other. keypad 8 toggles the radar antenna on and off and keypad 9 rotates one of the three canoes. keypad 3 throws the lifebelt into the sea and keypad 6 replaces the belt onto the holder.
EDIT .. warning: this program resets the screen to 1280 x 1024 x 32 - if you're running an older machine pls replace the first line of function setup() to a lower res. - the program also writes a 1024x1024 bitmap which should be likewise redimensioned to suit your machine caps.
to use the hotkeys as written you'll need a numpad - feel free to reassign the keys to your liking.
rem ********** seascape challenge entry **************
rem ********** owlman 03/06/10 ***********
#constant xzsq 32
#constant scaleterr 10.0
global dim shapexz(xzsq,xzsq) as integer
helpreq = -1
amdr =0
amwn =0
rdrrun=1
amdr2 = 0
amwn2 =0
setup()
gosub make_contour_map
gosub make_object_texture
gosub make_base_terrain
gosub make_sky
gosub make_extras
do
if upkey() then move object dummyobjectnum, 1
if downkey() then move object dummyobjectnum, -1
height# = get terrain ground height (terrnum, object position x (dummyobjectnum), object position z(dummyobjectnum) )
position object dummyobjectnum, object position x (dummyobjectnum),height#, object position z(dummyobjectnum)
if get terrain ground height (terrnum, object position x (dummyobjectnum), object position z(dummyobjectnum)) = 191
position camera 0, object position x(dummyobjectnum), object position y(dummyobjectnum) +10, object position z(dummyobjectnum)
else
height# = get terrain ground height (terrnum, camera position x(0), camera position z(0))
position object dummyobjectnum, camera position x(0), height#, camera position z (0)
endif
if leftkey()then yrotate camera 0, camera angle y() - 1
if rightkey()then yrotate camera 0, camera angle y() + 1
key = scancode()
if key = 79 and amdr <8
inc amdr,2
iddir = 1
ob = hutdoordummy
switches(ob,amdr, iddir,0)
endif
if key = 80 and amdr>0
dec amdr,2
iddir = 1
ob = hutdoordummy
switches(ob, amdr, iddir,0)
endif
if key = 75 and amwn<8
inc amwn,2
iddir=2
ob = hutwindowdummy
switches(ob, amwn, iddir,0)
endif
if key = 76 and amwn>0
dec amwn,2
iddir=2
ob = hutwindowdummy
switches(ob, amwn, iddir,0)
endif
if key = 72 and rdrrun= 1
rdrrun = 0
while scancode() = 72: endwhile
key = scancode()
endif
if key = 72 and rdrrun= 0
rdrrun = 1
while scancode() = 72 : endwhile
key = scancode()
endif
if shiftkey() and keystate(79) and amdr2<8
inc amdr2,2
iddir = 1
ob = doornum2
switches(ob,amdr2, iddir, 90)
endif
if shiftkey() and keystate(80) and amdr2>0
dec amdr2,2
iddir = 1
ob = doornum2
switches(ob,amdr2, iddir,90)
endif
if shiftkey() and keystate(75) and amwn2<8
inc amwn2,2
iddir = 3
ob = windownum2
switches(ob,amwn2, iddir,90)
endif
if shiftkey() and keystate(76) and amwn2>0
dec amwn2,2
iddir = 3
ob = windownum2
switches(ob,amwn2, iddir,90)
endif
if rdrrun =1 then turn object left hutarnum,1
if key = 73 then turn object left boatdummyobj,1
if key = 81 then texture limb lifebeltnum,0, lifebelttexturenum2
if key = 77 then texture limb lifebeltnum,0, lifebelttexturenum
center text 640,50, "TOGGLE HELP [F1]"
if key = 59 then helpreq = - helpreq
while scancode()=59:endwhile
if helpreq>0 then gosub showhelp
key = 0
loop
cleanup()
end
function setup()
hide mouse
set display mode 1280, 1024,32
color backdrop RGB(0,0,0) : backdrop on
autocam off
position camera 0, 0,10,0
point camera 0, 270, 0, 100
set ambient light 100
set image colorkey 0,0,0
set text size 32
set text font "ariel"
endfunction
make_contour_map:
gosub make_data_array
for x = 1 to 32
for z = 1 to 32
select shapexz(x-1,z-1)
case 1
dot x,z,rgb(40,40,40)
endcase
case 3,5, 2,6,7
dot x,z,RGB(191,191,191)
endcase
case 4
dot x,z,RGB(255,255,255)
endcase
case default
raise_alarm("out of range - shapexz(x,z)")
endcase
endselect
next z
next x
get image 1, 1,1,32,32
save image "contourmap.bmp",1
cls
return
make_object_texture:
for x = 1 to 32
for z = 1 to 32
select shapexz(x-1,z-1)
rem case 1: dot x,z,RGB(14,52,240) :endcase
case 1: dot x,z,RGB(255,255,46): endcase
case 2: dot x,z,RGB(255,255,0): endcase
rem case 3: dot x,z,RGB(177,181,73): endcase
case 5: dot x,z,RGB(255,255,70): endcase
case 4: dot x,z, RGB(179,182,136):endcase
rem case 5: dot x,z,RGB(197,200,66): endcase
case 3: dot x,z,RGB(142,120,100): endcase
case 6: dot x,z,RGB(254,255,106): endcase
case 7: dot x,z,RGB(0,0,200): endcase
case default: dot x,z,RGB(255,0,66): endcase
endselect
next z
next x
get image 2,1,1,32,32
save image "groundtexture.bmp", 2
skytexnum = get_image_num()
for x = 1 to 1024
for z= 1 to 1024
if z >345 and z < 400
dot x,z, RGB(212,244,254)
else
rem dot x,z, RGB(212,233,236)
dot x,z, RGB(4,193,255)
endif
if z<350 then dot x,z, RGB(178,236,255)
next z
next x
dot 400, 400, RGB(233,0,0)
dot 450, 450, RGB(233,0,0)
dot 700, 430, RGB(200,200,200)
for x = 100 to 300
dot x, 400, RGB(0,0,0)
dot x+300, 400, RGB(0,0,0)
dot x+700,400, RGB(0,0,0)
next x
for x= 730 to 850
dot x, 399, RGB(0,0,0)
next x
rem for x = 350 to 380
rem dot x, 399, RGB(0,0,0)
rem next x
ink rgb (255,255,255),rgb(255,255,255)
box 0, 180, 1024,350, RGB(178,236,255),RGB(178,236,255),RGB(212,244,254),RGB(212,244,254)
line 380, 200, 380, 300
line 800, 180, 550, 350
line 200, 200, 300, 380
ink RGB(212,244,254),0
line 1,350, 20, 190
line 5,180,5,350
line 10, 349, 50, 350
line 105, 349, 170, 350
line 20,350, 0, 340
ink RGB(178,236,255),0
line 1000, 330, 1020, 315
line 1025, 340, 990, 325
line 1025, 341, 1000, 326
line 500, 340, 750, 340
line 550, 339, 600, 339
box 1,410, 1024,700, RGB(212,244,254),RGB(4,193,255), RGB(212,244,254),RGB(4,193,255)
dot 420, 395, rgb(0,0,0)
dot 520, 395, rgb(0,0,0)
get image skytexnum, 1,1,1024,1024
save image "skytexture.jpg", skytexnum
woodhuttexture = get_image_num()
for x = 1 to 20
for y = 1 to 20
if x=1 or x= 10 or x=19 or y=1 or y=10
dot x,y, RGB(106,48,0)
else
rem dot x,y, RGB(155,101,91)
dot x,y,RGB(255,255,233)
endif
if (x>3 and x< 8) and (y> 3 and y< 8)
dot x,y, rgb(0,0,0)
endif
if ((x > 12 and x < 17) and Y > 3)
dot x, y, RGB(0,0,0)
endif
next y
next x
get image woodhuttexture, 1,1, 20, 20
save image "woodhuttexture.jpg", woodhuttexture
woodhutsidetexture = get_image_num()
for x = 1 to 20
for y = 1 to 20
if x=1 or x= 9 or x=18 or y=1 or y=10
dot x,y, RGB(106,48,0)
else
rem dot x,y, RGB(155,101,91)
dot x,y,RGB(255,255,233)
endif
next y
next x
get image woodhutsidetexture, 1,1, 20, 20
save image "woodhutsidetexture.bmp", woodhutsidetexture
woodhuttexturerooftiles = get_image_num()
for x = 1 to 20
for y = 1 to 20
if x=1 or x=19 or y=1 or y=19
dot x,y,rgb(106,48,0)
else
dot x,y, RGB(212,200,174)
endif
next y
next x
get image woodhuttexturerooftiles, 1,1, 20, 20
save image "woodhuttexturerooftiles.jpg", woodhuttexturerooftiles
woodhutdoor1texture = get_image_num()
for x = 1 to 20
for y = 1 to 20
if x=1 or x=2 or x=9 or x=10 or x=19 or x= 20 or y=1 or y = 2 or y = 3 or y = 4 or y= 19 or y= 18 or y=9 or y= 10
dot x,y,rgb(106,48,0)
else
dot x,y, RGB(0,0,0)
endif
next y
next x
get image woodhutdoor1texture, 1,1, 20, 20
save image "woodhutdoor1tex.jpg", woodhutdoor1texture
woodhutdoor2texture = get_image_num()
for x = 1 to 20
for y = 1 to 20
dot x,y, RGB(212,200,174)
next y
next x
get image woodhutdoor2texture, 1,1, 20, 20
save image "woodhutdoor2texture.jpg", woodhutdoor2texture
woodhutwindow1texture = get_image_num()
for x = 1 to 12
for y = 1 to 12
if x < 2 or x>10 or y<2 or y > 10
dot x,y,rgb(106,48,0)
else
dot x,y, RGB(0,0,0)
endif
next y
next x
get image woodhutwindow1texture, 1,1, 12, 12
save image "woodhutwindow1texture.bmp", woodhutwindow1texture
woodhutwindow2texture = get_image_num()
for x = 1 to 4
for y = 1 to 4
dot x,y, RGB(233,232,243)
next y
next x
get image woodhutwindow2texture, 1,1, 4, 4
save image "woodhutwindow2texture.bmp", woodhutwindow2texture
woodtable2texture = get_image_num()
for x = 1 to 20
for y = 1 to 20
if x=1 or x=19 or y=1 or y=19
dot x,y,rgb(106,48,0)
else
dot x,y, RGB(148,117,0)
endif
next y
next x
get image woodtable2texture, 1,1, 20, 20
save image "woodtable2texture.jpg", woodtable2texture
boattex= get_image_num()
for x = 1 to 512
for y = 1 to 512
dot x,y,RGB(36,192,0)
next y
next x
get image boattex,1,1,512,512
save image "boattex.bmp", boattex
boattex2 = get_image_num()
for x = 1 to 512
for y = 1 to 512
dot x,y,RGB(192,36,0)
next y
next x
get image boattex2,1,1,512,512
save image "boattex2.bmp", boattex2
boattex3 = get_image_num()
for x = 1 to 512
for y = 1 to 512
dot x,y, RGB(195,195,0)
next y
next x
get image boattex3,1,1,512,512
save image "boattex3.bmp", boattex3
treetex1 = get_image_num()
for x = 1 to 512
for y = 1 to 512
dot x,y, RGB(110,70,0)
next y
next x
get image treetex1,1,1,512,512
save image "treetex1.bmp", treetex1
treetex2 = get_image_num()
for x = 1 to 512
for y = 1 to 512
dot x,y, RGB(18,128,0)
next y
next x
get image treetex2,1,1,512,512
save image "treetex2.bmp", treetex2
rem lifebelttexture
lifebelttexturenum = get_image_num()
for x = 0 to 20
for y = 0 to 20
dot x, y,RGB(255,255,233)
next y
next x
for x = 3 to 7
if x = 3 or x = 4
ink rgb(200,33,0),0
else
if x = 6 or x = 7
ink rgb(200,33,0),0
else
ink RGB(255,66,0),0
endif
endif
circle 10,10,x
next x
get image lifebelttexturenum, 1,1,20,20
save image "lifebelttexturenum.bmp", lifebelttexturenum
lifebelttexturenum2 = get_image_num()
for x = 0 to 20
for y = 0 to 20
dot x, y,RGB(255,255,233)
next y
next x
get image lifebelttexturenum2, 1,1,20,20
save image "lifebelttexturenum2.bmp", lifebelttexturenum2
return
make_base_terrain:
texnum = get_image_num()
load image "groundtexture.bmp",texnum
connum = get_image_num()
load image "contourmap.bmp", connum
terrnum = get_object_num()
make object terrain terrnum
set terrain heightmap terrnum, "contourmap.bmp"
set terrain scale terrnum, 10.0, 1.0, 10.0
set terrain texture terrnum, texnum, texnum
set terrain tiling terrnum, 32
build terrain terrnum
ypos# = get terrain ground height(terrnum,200.0,200.0)-50
position camera 200.0, 200.0 ,200.0
dummyobjectnum = get_object_num()
make object cube dummyobjectnum, 0
return
make_sky:
skynum = get_object_num()
make object sphere skynum, 3000, 50,50
set object cull skynum, 0
texture object skynum, skytexnum
return
make_extras:
basenum = get_object_num()
make object box basenum, 70,50,1
xrotate object basenum, -90
position object basenum, 150,191,220
texture object basenum, woodhuttexturerooftiles
walkobj = get_object_num()
make object box walkobj, 10, 30,1
position object walkobj, object position x(basenum)+20, 191, object position z(basenum) +40
rotate object walkobj, 90,0,0
texture object walkobj,woodhuttexturerooftiles
tablenum = get_object_num()
make object box tablenum, 15, 0.5,1
tablems1 = get_mesh_num()
make mesh from object tablems1, tablenum
add limb tablenum, 1, tablems1
offset limb tablenum, 1, 0,0, -2
add limb tablenum, 2, tablems1
offset limb tablenum, 2, 0,0,2
add limb tablenum, 3, tablems1
offset limb tablenum, 3, 0, -3, -3
add limb tablenum, 4, tablems1
offset limb tablenum, 4, 0, -3, 3
add limb tablenum, 5, tablems1
scale limb tablenum, 5, 50.0, 100.0,100.0
rotate limb tablenum, 5, 0, 90, 90
offset limb tablenum, 5, 6,-4,0
add limb tablenum, 6, tablems1
scale limb tablenum, 6, 50, 100, 100
rotate limb tablenum, 6, 0,90,90
offset limb tablenum, 6, -6, -4,0
add limb tablenum, 7, tablems1
scale limb tablenum, 7, 50, 100,100
rotate limb tablenum, 7, 90,90,0
offset limb tablenum, 7, 0,-1.5,0
texture object tablenum, woodtable2texture
for x = 1 to 7
texture limb tablenum, x, woodtable2texture
next x
tablenum2 = get_object_num()
instance object tablenum2, tablenum
tablenum3 = get_object_num()
instance object tablenum3, tablenum
yrotate object tablenum3, 60
position object tablenum, object position x(basenum) -23, 196, object position z(basenum) + 9
position object tablenum2, object position x(basenum) , 196, object position z(basenum) - 15
position object tablenum3, object position x(basenum)+23 , 196, object position z(basenum)
rem end table
rem hut
hutnum = get_object_num()
make object sphere hutnum, 0
hutbx = get_object_num()
make object box hutbx, 20,20,0.1
hutmeshnum = get_mesh_num()
make mesh from object hutmeshnum, hutbx
delete object hutbx
hutsidenum = get_mesh_num()
make object box hutbx, 10,20,0.1
make mesh from object hutsidenum, hutbx
delete object hutbx
hutroofnum = get_mesh_num()
make object box hutbx, 20,9,0.1
make mesh from object hutroofnum, hutbx
delete object hutbx
hutsideroofnum = get_mesh_num()
make object triangle hutbx, 0, 0, 0, 0, 0, 10, 0,5,5
make mesh from object hutsideroofnum, hutbx
delete object hutbx
hutfloornum= get_mesh_num()
make object box hutbx, 20,10,0.3
make mesh from object hutfloornum, hutbx,
delete object hutbx
add limb hutnum, 1, hutmeshnum
add limb hutnum, 2, hutsidenum
add limb hutnum, 3, hutroofnum
add limb hutnum, 4, hutsideroofnum
add limb hutnum, 5, hutmeshnum
add limb hutnum, 6, hutsidenum
add limb hutnum, 7, hutsideroofnum
add limb hutnum, 8, hutroofnum
add limb hutnum, 9, hutfloornum
offset limb hutnum, 1, 0, 0,-10
offset limb hutnum, 2, 10, 0,- 5
rotate limb hutnum, 2, 0, 90, 0
offset limb hutnum, 3, 0, 12, -8
rotate limb hutnum, 3, 45, 0, 0
offset limb hutnum, 4, 9.5, 10, 0
rotate limb hutnum, 4, 0,180, 0
offset limb hutnum, 5, 0, 0, 0
offset limb hutnum, 6, -10,0, -5
rotate limb hutnum, 6, 0,-90,0
offset limb hutnum, 7, -10,10,0
rotate limb hutnum, 7, 0, -180,0
offset limb hutnum, 8, 0,12,-2
rotate limb hutnum, 8, -45,0,0
offset limb hutnum, 9, 0,0,-5
rotate limb hutnum, 9, 90,0,0
texture limb hutnum, 1, woodhuttexture
texture limb hutnum, 2, woodhutsidetexture
texture limb hutnum, 3, woodhuttexturerooftiles
texture limb hutnum, 4, woodhuttexturerooftiles
texture limb hutnum, 5, woodhutsidetexture
texture limb hutnum, 6, woodhutsidetexture
texture limb hutnum, 7, woodhutsidetexture
texture limb hutnum, 8, woodhuttexturerooftiles
texture limb hutnum, 9, woodhuttexturerooftiles
hutdoordummy = get_object_num()
make object sphere hutdoordummy, 0
hutdoor1num = get_mesh_num()
hutdoortempbx = get_object_num()
make object box hutdoortempbx, 5,8,0.2
make mesh from object hutdoor1num, hutdoortempbx
delete object hutdoortempbx
add limb hutdoordummy, 1,hutdoor1num
offset limb hutdoordummy,1, -2.5,0,0
texture limb hutdoordummy, 1, woodhutdoor1texture
scale limb texture hutdoordummy, 1, 2,2
add limb hutdoordummy, 2, hutdoor1num
offset limb hutdoordummy, 2, -2.5, 0.5, 0.2
texture limb hutdoordummy, 2, woodhutdoor2texture
scale limb hutdoordummy, 2, 100, 100.2, 100
hutwindowdummy = get_object_num()
make object sphere hutwindowdummy,0
hutwindowtempbx = get_object_num()
hutwindow1num = get_mesh_num()
make object box hutwindowtempbx, 6, 6, 0.3
make mesh from object hutwindow1num, hutwindowtempbx
delete object hutwindowtempbx
make object box hutwindowtempbx, 5,5,0.3
hutwindow2num = get_mesh_num()
make mesh from object hutwindow2num, hutwindowtempbx
delete object hutwindowtempbx
add limb hutwindowdummy, 1, hutwindow1num
texture limb hutwindowdummy, 1, woodhutwindow1texture
add limb hutwindowdummy, 2, hutwindow2num
texture limb hutwindowdummy, 2, woodhutwindow2texture
set object transparency hutnum, 4
set object transparency hutdoordummy, 4
set object transparency hutwindowdummy, 4
hut2 = get_object_num()
instance object hut2, hutnum
position object hutnum, 160,192, 240
position object hut2, 120, 192, 210
position object hutdoordummy, object position x(hutnum)+7, 196, object position z(hutnum)-10
doornum2 = get_object_num()
clone object doornum2, hutdoordummy, 0
yrotate object doornum2, -90
position object doornum2, object position x(hut2)+10, 196, object position z(hut2)+7
offset limb doornum2, 2, -2.5 , 0, 0.1
rem yrotate object hutnum, 0
yrotate object hut2, -90
position object hutwindowdummy, object position x(hutnum)-4.8, 196.8 ,object position z(hutnum)-10
windownum2 = get_object_num()
clone object windownum2, hutwindowdummy,0
yrotate object windownum2, 90
position object windownum2, object position x(hut2)+10,196.8, object position z(hut2)-5
hutarnum = get_object_num()
hutarnumms = get_mesh_num()
make object box hutarnum, 0.3,0.3,4.0
make mesh from object hutarnumms, hutarnum
position object hutarnum, object position x (hutnum), 209, object position z(hutnum)-3
add limb hutarnum, 1, hutarnumms
add limb hutarnum, 2, hutarnumms
add limb hutarnum, 3, hutarnumms
rotate limb hutarnum, 1, 0,90,0
rotate limb hutarnum, 2, 0,90,0
rotate limb hutarnum, 3, 90,0,0
offset limb hutarnum,1, 0,0,-2
offset limb hutarnum, 2, 0,0,2
offset limb hutarnum, 3, 0,-1.6,0
texture object hutarnum, woodhutwindow2texture
rem end hut
rem boat
tempobj=get_object_num()
boatmesh1 = get_mesh_num()
make object box tempobj, 20,10,10
make mesh from object boatmesh1,tempobj
delete object tempobj
boatmesh2 = get_mesh_num()
make object triangle tempobj, -25,3,0, -10,-5,5, -10,-5,-5
make mesh from object boatmesh2,tempobj
delete object tempobj
boatmesh3 = get_mesh_num()
make object triangle tempobj,25,3,0, 10,-5,5, 10,-5,-5
make mesh from object boatmesh3,tempobj
delete object tempobj
boatdummyobj = get_object_num()
make object sphere boatdummyobj, 0
lock vertexdata for mesh boatmesh1
add mesh to vertexdata boatmesh2
add mesh to vertexdata boatmesh3
unlock vertexdata
add limb boatdummyobj,1,boatmesh1
add limb boatdummyobj,2,boatmesh2
add limb boatdummyobj,3,boatmesh3
for x = 1 to 3
texture limb boatdummyobj,x, boattex
next x
lock vertexdata for limb boatdummyobj,1
set vertexdata position 0, -15,0,-5
set vertexdata position 4, -15,0,5
set vertexdata position 11, -15,0,-5
set vertexdata position 20, -15,0,-5
set vertexdata position 8, -15, 0,5
set vertexdata position 23, -15,0,5
set vertexdata position 1, 15,0,-5
set vertexdata position 10, 15,0,-5
set vertexdata position 16,15,0,-5
set vertexdata position 7, 15,0,5
set vertexdata position 9, 15,0,5
set vertexdata position 17, 15,0,5
set indexdata 32,24
set indexdata 35,24
set indexdata 31,26
set indexdata 33,25
set indexdata 27,27
set indexdata 24,27
unlock vertexdata
scale object boatdummyobj, 70,100,70
set object cull boatdummyobj,0
boatobj2= get_object_num()
clone object boatobj2, boatdummyobj
boatobj3= get_object_num()
clone object boatobj3, boatdummyobj
for x = 1 to 3
texture limb boatobj2,x, boattex2
texture limb boatobj3,x, boattex3
next x
position object boatdummyobj, 100, 193,75
position object boatobj2, 140, 193,75
rotate object boatobj2, 0, 45,0
position object boatobj3, 120, 193,75
rotate object boatobj3, 0, 70,0
rem tree
treerootobj = get_object_num()
make object sphere treerootobj, 0.2,50,50
treetempobj= get_object_num()
make object sphere treetempobj, 5,50,50
lock vertexdata for limb treetempobj,0
ttlv =get vertexdata vertex count()
for tv = 0 to ttlv-1
y#= get vertexdata position y(tv)
if y#<0
x#= get vertexdata position x(tv)
y#=-3
if x#>0 then x#=x#+5
z#=get vertexdata position z(tv)
set vertexdata position tv, x#,y#,z#
endif
next tv
unlock vertexdata
lock vertexdata for limb treerootobj,0
ttlverts=get vertexdata vertex count()
for tv = 0 to ttlverts-1
y#= get vertexdata position y(tv)
if y#<0
x#=get vertexdata position x(tv)
y#=-40
z#= get vertexdata position z(tv)
if y#<-38
if x# <0 then x# = -1 else x#=1
if z#<0 then z#=-1 else z#=1
endif
if y#>-10 then x#=x# +5
set vertexdata position tv,x#,y#,z#
endif
next tv
unlock vertexdata
treems1 = get_mesh_num()
make mesh from object treems1,treetempobj
delete object treetempobj
add limb treerootobj, 1, treems1
offset limb treerootobj, 1, 0,-38,0
texture limb treerootobj,0,treetex1
texture limb treerootobj,1,treetex1
set object cull treerootobj, 0
position object treerootobj, 250,230,120
rem leaf
lfdummyobj = get_object_num()
make object sphere lfdummyobj,0
lftemp = get_object_num()
leafmesh1num = get_mesh_num()
make object triangle lftemp, 0,0,0, -1,6,0, 0,6,1
make mesh from object leafmesh1num, lftemp
delete object lftemp
leafmesh2num = get_mesh_num()
make object triangle lftemp, 0,0,0, 0,6,1, 1,6,0
make mesh from object leafmesh2num, lftemp
delete object lftemp
leafmesh3num = get_mesh_num()
make object triangle lftemp, 0,6,1, -1,6,0, 0,10,3
make mesh from object leafmesh3num, lftemp
delete object lftemp
leafmesh4num = get_mesh_num()
make object triangle lftemp, 0,6,1, 0,10,3, 1,6,0
make mesh from object leafmesh4num, lftemp
delete object lftemp
add limb lfdummyobj, 1, leafmesh1num
add limb lfdummyobj, 2, leafmesh2num
add limb lfdummyobj, 3, leafmesh3num
add limb lfdummyobj, 4, leafmesh4num
leafmesht= get_mesh_num()
make mesh from object leafmesht,lfdummyobj
delete object lfdummyobj
for lf = 2 to 13
inc anglf, 30
add limb treerootobj, lf, leafmesht
scale limb treerootobj, lf, 100,200,100
rotate limb treerootobj, lf, -130,anglf,0
texture limb treerootobj, lf, treetex2
next lf
for lf = 14 to 25
inc anglf, 30
add limb treerootobj, lf, leafmesht
scale limb treerootobj, lf, 100,180,100
rotate limb treerootobj, lf, -100,anglf,0
texture limb treerootobj, lf, treetex2
next lf
for lf = 26 to 37
inc anglf, 30
add limb treerootobj, lf, leafmesht
scale limb treerootobj, lf, 100,150,100
rotate limb treerootobj, lf, 30,anglf,0
texture limb treerootobj, lf, treetex2
next lf
set object cull treerootobj, 0
tree2 = get_object_num()
instance object tree2,treerootobj
position object tree2, 270, 228, 100
rotate object tree2, 0,0,-15
rotate limb tree2, 1, 0,90,50
for lf = 2 to 37
rotate limb tree2, lf, 30,0,0
next lf
rem lifebelt
lifebeltnum = get_object_num()
make object box lifebeltnum, 10,10, 0.5
for x = 1 to 7
add limb lifebeltnum, x, tablems1
next x
rotate limb lifebeltnum, 1, 90, 0, 0
offset limb lifebeltnum, 1, 0,5,-0.5
scale limb lifebeltnum, 1, 70,100,100
rotate limb lifebeltnum, 2, 90,0,0
offset limb lifebeltnum, 2, 0,-5,-0.5
scale limb lifebeltnum, 2, 70,100,100
offset limb lifebeltnum, 3, 0,-7,1
rotate limb lifebeltnum, 3, 0,0,90
scale limb lifebeltnum, 3, 200,200,200
rotate limb lifebeltnum, 4, 0,0,90
offset limb lifebeltnum, 4, 5,0,0
scale limb lifebeltnum, 4, 70,100,100
rotate limb lifebeltnum, 5, 0,0,90
offset limb lifebeltnum, 5, -5,0,0
scale limb lifebeltnum, 5, 70,100,100
rotate limb lifebeltnum, 6, 0,0,90
offset limb lifebeltnum, 6, -20,-7,-20
rotate limb lifebeltnum, 7, 0,0,90
offset limb lifebeltnum, 7, 20,-7,-20
for x = 1 to 7
texture limb lifebeltnum, x, woodtable2texture
next x
texture limb lifebeltnum,0, lifebelttexturenum
yrotate object lifebeltnum, 50
position object lifebeltnum, 260, 198, 215
scale object lifebeltnum, 70,70,70
point camera 0, 210, 200, 110
return
function switches(ob,i, obdirid, fac)
if obdirid = 1 then yrotate object ob, 10*i-fac
if obdirid=2 then xrotate object ob, 10*i
if obdirid = 3 then zrotate object ob, 10*i
endfunction
function get_object_num()
for objnum = 1 to 55555
if object exist(objnum) = 0
exitfunction objnum
endif
next objnum
endfunction 0
function get_image_num()
for imagenum = 1 to 55555
if image exist(imagenum) = 0
exitfunction imagenum
endif
next imagenum
endfunction 0
function get_mesh_num()
for meshnum= 1 to 55555
if mesh exist(meshnum)=0
exitfunction meshnum
endif
next meshnum
endfunction 0
function cleanup()
for i = 1 to 55555
if object exist(i)
delete object i
else
exit
endif
next i
for i = 1 to 55555
if image exist(i)
delete image i
else
exit
endif
next i
endfunction
make_data_array:
for x = 0 to 31
for z = 0 to 31
read shapexz(x,z)
next z
next x
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1,1,1,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1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
return
function raise_alarm(s$)
set cursor 10,10
print s$
wait key
endfunction
showhelp:
ink rgb(255,0,0),0
center text 640, 160, "Welcome to owlman island"
center text 640,220, "hotkey help: (numeric keypad unless stated))"
center text 640, 300, "open refreshment hut doors - [shift] + 1"
center text 640, 350,"close refreshment hut doors - [shift] + 2"
center text 640, 400,"open refreshment hut windows (for easier cleaning) - [shift] + 4"
center text 640, 450, "close refreshment hut windows - [shift] + 5"
center text 640, 500, "toggle radar antenna on/off (affects radar system - disable with caution)- 8"
center text 640, 550, "rotate green canoe - 9"
center text 640, 600, "jettison lifebelt into sea - 3"
center text 640, 650, "replace lifebelt onto holder - 6"
center text 640, 700, "the following camera keys are also available: "
center text 640, 750, " move north - south: down arrow | south - north: - up arrow | rotate camera left/ right arrow as required"
center text 640, 800, "thank you for your visit today - please take litter home. "
return
"You look like a bear holding on to a balloon," you said.
"Not," said Pooh anxiously, "not like a small black cloud in a blue sky?" -