Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / I can't complete my game

Author
Message
Riffster
19
Years of Service
User Offline
Joined: 17th Jan 2005
Location:
Posted: 17th Jan 2005 07:17
this is what i got and it wont load right. also how do i creat multiple enimies that walk from place to place


rem _____________
` * *
` * Gunner *
` * *
` _____________

rem Create fog and ambience
set ambient light 40
if fog available()=1
fog on : fog distance 5000000000 : fog color rgb(10,70,30)
endif

rem Load and create images
load bitmap "sands.bmp",1
get image 13,0,0,256,256
ink rgb(255,255,255),rgb(150,150,255) : cls
for t=1 to 10000 : dot rnd(256),rnd(256) : next t
blur bitmap 1,1
get image 1,0,0,256,256
delete bitmap 1

rem Load images
gosub _loadimages

rem Make landscape
landsize=10000
set camera range 10,landsize*2
make matrix 1,landsize*2,landsize*2,25,25
prepare matrix texture 1,13,4,4
randomize matrix 1,200

rem Texture landscape
for z=0 to 24
for x=0 to 24

rem Shaded dirt and grass
shade=getshade(x,z)
set matrix tile 1,x,z,shade

rem Roads
if z=12 or x=12
lvl=rnd(2)
lvl#=0.0-(lvl*10.0)
set matrix tile 1,x,z,13+lvl
set matrix height 1,x,z,lvl#
set matrix height 1,x+1,z,lvl#
set matrix height 1,x,z+1,lvl#
set matrix height 1,x+1,z+1,lvl#
endif

next x
next z
update matrix 1

rem Create a tilt object (to handle "independent" X & Z axis rotation)
make object cone 1,5


rem Character
load bitmap "HIPS.bmp",(7)
load bitmap "HEAD.bmp",(2)
load bitmap "PANTS.bmp",(3)
load bitmap "SKIN.bmp",(4)
load bitmap "TSHIRT.bmp",(5)
load bitmap "MAN2.X",(6)
scale object 6,100,100,100 :rem 75,75,75
yrotate object 6,180
fix object pivot 6
rem stay on graound
glue object to limb 6,1,0
rem load gun
load bitmap "GUN19.X",(8)
rem second gun
load bitmap "PLASCAN.X",(9)

rem Tank track texture
`load bitmap "irontank\tanktrak.bmp",6
get image 2,0,0,128,128
get image 3,0,0,128,128
set current bitmap 0


rem Apply texture to tank tracks
texture limb 6,12,2
texture limb 6,15,2




rem Create small bullet
make object sphere 3,50
texture object 3,6


rem Create spherical sky
make object sphere 4,(landsize*2)+200
set object collision off 4
scale object 4,100,50,100
set object 4,1,1,0
texture object 4,1
fade object 4,0
backdrop off

rem Create map stat
load image "map.bmp",5
make object plain 51,256,256
lock object on 51
position object 51,-490,-340,800
ghost object on 51
texture object 51,5

rem Small ground of perimitor trees
load image "tree.bmp",4
make object plain 52,200,400 : make mesh from object 52,52
add limb 52,1,52 : rotate limb 52,1,0,90,0
make mesh from object 52,52 : delete object 52
make object 52,52,0
range=5000
halfrange=range/2
for t=1 to 80
if t>=1 and t<=20 : rx=rnd(range) : rz=range : endif
if t>20 and t<=40 : rx=range : rz=rnd(range) : endif
if t>40 and t<=60 : rx=rnd(range) : rz=0 : endif
if t>60 and t<=80 : rx=0 : rz=rnd(range) : endif
rx=(rx-5000)+rnd(1000)
rz=(rz-50)+rnd(1000)
if rx>halfrange-250 and rx<halfrange+250 then rx=halfrange-250
if rz>halfrange-250 and rz<halfrange+250 then rz=halfrange-250
add limb 52,t,52
offset limb 52,t,rx,0,rz
next t
make mesh from object 52,52 : delete object 52 : make object 52,52,4
position object 52,landsize-(halfrange),190,landsize-(halfrange)
set object 52,1,0,0

rem Set game variables
x#=landsize
z#=landsize
bulletalive=1
cx#=landsize
cy#=3000
cz#=landsize-3000

rem Begin main loop
lowmode=0
do

rem Low Mode switch
if lower$(inkey$())="l" and lowmode=0
lowmode=1

backdrop on
color backdrop rgb(0,0,0)
fog off
endif

rem Control tank
if upkey()=1 and s#<50.0 then s#=s#+5.0
if downkey()=1 and s#>-50.0 then s#=s#-3.375
if leftkey()=1 then s#=s#+0.0 : a#=wrapvalue(a#-12)
if rightkey()=1 then s#=s#+0.0 : a#=wrapvalue(a#+12)
if shiftkey()=1 and s#>-150.0 then s#=s#-175.0
if controlkey()=1 and s#<150.0 then s#=s#+175.0
`if leftkey()=1
` x#=newxvalue(x#,wrapvalue(cya#-90.0),6.0)
` z#=newzvalue(z#,wrapvalue(cya#-90.0),6.0)
` gunlag#=1.1
`endif
`if rightkey()=1
` x#=newxvalue(x#,wrapvalue(cya#+90.0),6.0)
` z#=newzvalue(z#,wrapvalue(cya#+90.0),6.0)
` gunlag#=1.1
`endif

rem End of decal loop
` next d

rem New smoke
` if aftersmoke>0
` d=aftersmoke : makesmoke(decal#(d,2),decal#(d,3),decal#(d,4),0.5)
` aftersmoke=0
` endif

`endfunction

`function scrolltanktracks(s#)

rem Scroll the tank track texture
` scroll limb texture 2,12,s#/60.0,0
` scroll limb texture 2,15,s#/60.0,0

`endfunction

function getshade(x,z)

rem Calculate shade value from surrounding tiles
nav#=0 : navc=0
for tx=-1 to 1
for tz=-1 to 1
nx=x+tx
nz=z+tz
if nx>=0 and nx<=24
if nz>=0 and nz<=24
nav#=nav#+get matrix height(1,nx,nz)
inc navc
endif
endif
next tz
next tx
shade=abs(nav#/navc)/10.0
if shade<0 then shade=0
if shade>10 then shade=10

endfunction shade

rem Smooth control camera
cdx#=newxvalue(x#,a#,-500)
cdz#=newzvalue(z#,a#,-500)
cdy#=get ground height(1,cx#-mx#,cz#-mz#)+100
if cdy#<225 then cdy#=225
cx#=curvevalue(cdx#,cx#,10)
cy#=curvevalue(cdy#,cy#,10)
Rem up down
cz#=curvevalue(cdz#,cz#,10)
position camera cx#,cy#,cz#
point camera x#,get ground height(1,x#-mx#,z#-mz#)+6,z#
Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 19th Jan 2005 01:22
Simple way = Create boxes, put them where you want your guy to patrol to and from. Hide the boxes then move and point your object at the first box. When it collides with it make it turn around and go to the other box and Vice/Versa


Thanks to Animeblood for the Logo!

Login to post a reply

Server time is: 2024-09-23 09:30:50
Your offset time is: 2024-09-23 09:30:50