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.

DarkBASIC Discussion / What is wrong!!!!

Author
Message
The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 6th Jun 2004 00:33
hi!!
1.when i compile the game it said... That there is something whit "endif"?? what can that be???
2. Is it hard to be a gamedeveloper???
i have dreamt about being it since i was 9!!!!
Lzdude69
21
Years of Service
User Offline
Joined: 21st May 2004
Location: Indiana
Posted: 6th Jun 2004 00:37
oh you mean a nesting error? Yeah, that means you have your endif in the wrong place, show me a snippet and I'll see whats wrong.

When I die, I want to be burried upside down, so thy critics, can kiss my a$$...
The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 6th Jun 2004 02:51
rem make bullet
make object sphere 102,2
texture object 102,2
hide object 102
rem make monster explosion
make object sphere 130,20
texture object 130,2
ghost object on 130
hide object 130
make object sphere 131,20
texture object 131,2
ghost object on 131
hide object 131
rem load monsterperparticles
load image "fire.bmp",2
for x =1000 to 110
make object plain x+10,5,5
texture object x+10,2
set object x+10,1,0,0
ghost object on x+10
hide object x+10
next x
mpn=110
load 3dsound "bird.wav",102
load 3dsound "dog.wav",103
if monsterbulletlife > 0 then gosub monstershootbullet
if monsterexplode > 0
gosub monsterexploderocket
else
gosub monsterai
endif
rem simple monster missil
monsterai:
point object 3,x#,y#,z#
pdist=sqrt((mx# - x#)^2 + (MY#+25 - Y#)^2 + (MZ# - Z#)^2)
IF PDIST<1500
if monsterbulletlife=0 or monsterbulletlife < 500-pdist/10
point object 3,x#,y#-25,z#
position object 102,mx#,my#+25,mz#
set object to object orientation 102,3
monsterbulletlife =500
show object 102
loop sound 102
endif
endif
return
rem skyd monster skud
monstershootbullet:
dec monsterbulletlife
move object 102,12
mbx#=object position x(102)
mbx#=object position y(102)
mbx#=object position z(102)
inc mpn
if mpn=121 then mpn=110
scale object mpn,100,100,100
position object mpn,mbx#,mby#,mbz#
position sound 102,mbx#,mby#,mbz#
point object mpn,x#,y#,z#
zrotate object mpn,rnd(180)
show object mpn
for x = 1 to 10
scale object int((wrapvalue((mpn-9+x)*36))/36)+110,100+x*25,100+x*25,100+x*25
next x
if mby# < get ground height(1,mbx#,mbz#) then monsterbulletlife=0
pdist=sqrt((x# - mbx#)^2 + (z# - mbz#)^2)
if pdist<50
gosub placeplayer
monsterbulletlife = 0
endif
rem guided missile
if pdist <500 and pdist>250 then point object 102,x#,y#,z#
if pdist > 100 then point object 102,x#,y#,z#
hide object 102
stop sound 102
for x=110 to 120
hide object x
next x
monsterexplode = 20
return
rem explode monster bullet
monsterexploderocket:
position object 130,mbx#,mby#,mbz#
show object 130
position object 131,mbx#,mby#,mbz#
show object 131
escale=20*(30-monsterexplode)
scale object 130,escale,escale,escale
yrotate object 130,wrapvalue(monsterexplode*37)
scale object 131,escale/1.5,escale/1.5,escale/1.5
yrotate object 131,wrapvalue(359-monsterexplode*37)
dec monsterexplode
if monsterexplode = 0 then hide object 130: hide object 131
if monsterexplode=18
position sound 103,x#,y#,z#
play sound 103
endif
if monsterexplode < 15 then position sound 103,x#,y#,z#
return


here you go.....
Lost in Thought
21
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 6th Jun 2004 05:36
Is some of your code missing? You have "gosub placeplayer" but no sub or label called placeplayer:

"People don't fail ..... they stop trying." Specs. P4 2.8GHz 800 FSB | 512MB DDR333
GeForce FX 5200 AGP 256MB | Windows XP Pro Full
Arkheii
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: QC, Philippines
Posted: 6th Jun 2004 11:21
Oh my... Your code is so hard to read. You should separate them into blocks and indent your code.



Login to post a reply

Server time is: 2025-05-24 02:59:06
Your offset time is: 2025-05-24 02:59:06