That all works fine inside the dark basic editor but when I "Build Final" and run it, it flashes the end game screen and exits to windows instead of waiting for players return key.
Here's the whole of my code can anyone suggest why this is happening.
rem setup program
sync on
sync rate 30
hide mouse
goal=0
set display mode 1024,768,32
rem make matrix
make matrix 1,2000,2000,50,50
rem texture matrix
load image "grass2.bmp",1
prepare matrix texture 1,1,1,1
fill matrix 1,0,1
rem randomize the matrix
randomize matrix 1,20
rem make 10 cones, place and colour randomly
for x=1 to 10
make object cone x,100
randomize timer()
position object x,rnd(1800)+100,50,rnd(1800)+100
ghost object on x
color object x,rgb(200+rnd(255),rnd(200+255),rnd(200+255))
ox#=object position x(x)
oz#=object position z(x)
next x
rem backdrop and fog
backdrop on
set camera range 1,1000
fog on
fog distance 4000
fog color rgb(100,100,200)
color backdrop rgb(100,100,200)
rem position camera for starting position
position camera 100,get ground height(1,100,100),100
yrotate camera 0.00000001
rem load music
load music "Northern Lights.mid",3
loop music 3
stop music 3
load image "winscreen.bmp",2
paste image 2,0,0
if returnkey()=1
end
endif
return
rem main loop
while end=0
rem store camera angle
caY#= Camera angle Y()
rem control input for camera movement
if upkey()=1
Xtest# = newxvalue(X#,caY#,20)
Ztest# = newzvalue(Z#,caY#,20)
if Xtest#>0 and Xtest#<2000 and Ztest#>0 and Ztest#<2000
move camera 5
endif
endif
if downkey()=1 then move camera -5
if leftkey()=1 then Yrotate camera Wrapvalue(caY#-5)
if rightkey()=1 then Yrotate camera Wrapvalue(caY#+5)
rem store camera position
X#=camera position x()
Y#=get ground height(1,x#,z#)
Z#=camera position z()
rem position the camera just above the floor
position camera X#,Y#+20,Z#
rem check to see if the player has found the cone
if X#>ox#-50 and X#<ox#+50 and Z#>oz#-50 and Z#<oz#+50
stop music 3
load image "winscreen.bmp",2
paste image 2,0,0
goal=1
X#=Z#
Z#=Z#
endif
if goal=1 and returnkey()=1
end=1
endif
rem refresh screen
sync
endwhile