can someone please help me with my levels i don't know how to add a level 2, and can someone help me with the try again "y" button, please help!!!!!!! Thank you
Rem Project: Disaster Dash
Rem Created: 01/05/2014 17:53:00
rem Init for best performance
sync on : sync rate 60 : backdrop off : hide mouse
if check display mode(1024,768,32)=1 then set display mode 1024,768,32
rem Loading screen
rem load bitmap "media\gfx\backdrop.jpg",1
rem copy bitmap 1,0,0,640,480,0,0,0,screen width(),screen height()
rem sync : delete bitmap 1
rem Setup strapline
rem gosub _create_strap
rem Setup terrain
load image "media\world\land.bmp",1
load bitmap "media\world\land.bmp",1
for m=0 to 7
make matrix 1+m,512,512,32,32 : position matrix 1+m,0,-2,512*m
prepare matrix texture 1+m,1,33,33 : set matrix texture 1+m,2,1
next m
set current bitmap 1
lock pixels
tc=1
for z=0 to 31
for x=0 to 31
col=point(x,z)
h#=rgbr(col)/4.0
for m=0 to 7
set matrix height 1+m,x,z,h#
set matrix tile 1+m,31-x,z,tc
next m
inc tc
next x
inc tc
next z
unlock pixels
delete bitmap 1
for m=0 to 7 : update matrix 1+m : next m
set current bitmap 0
MainSection:
REM DECLARE VARIABLES
MyTimer = 1800 : rem MyTimer / sync rate = seconds on timer (approx.)
Gravity# = 0.30 : rem How powerful gravity is
MyPower = 10.25 : rem How strong the player can jump
MySpeed = 14 : rem How fast the player can run
rem Create high quality road surface
load image "E:\Disaster Dash\media\dirt.jpg",11
for r=0 to 7
make object plain 11+r,128,512
position object 11+r,256+10,0.025,512*r
texture object 11+r,11
xrotate object 11+r,90
set object texture 11+r,1,1
scale object texture 11+r,2,8
next r
rem Load sky and set it up
set camera range 2.5,15000
load object "media\sky\os.x",1
position object 1,256,30,0
set object texture 1,2,1
set object light 1,0
set object cull 1,0
yrotate object 1,270
scale object 1,250,250,250
rem Setup mountain range
set image colorkey 255,0,255
load image "media\sky\mountains.bmp",4
make object plain 4,1024*20.5,128*20.5
set object texture 4,2,1
set object light 4,0
set object 4,1,1,0
texture object 4,4
rem Two bikes
rem for c=0 to 1
REM OBJECT CREATION
make object cylinder 101,50
load image "E:\Disaster Dash\media\guyrunning.jpg",82
scale object 101,63,50,25
texture object 101,82
position object 101,250,10,400
make object collision box 101,-25,-35,-25,25,35,25,0
REM OBJECT tree log
make object cylinder 102,50
load image "E:\Disaster Dash\media\wood.jpg",83
scale object 102,125,100,50
texture object 102,83
position object 102,210,10,400
make object collision box 102,-25,-35,-25,25,35,25,0
xrotate object 102,90
yrotate object 102,100
zrotate object 102,0
REM OBJECT tree
make object sphere 103,50
load image "E:\Disaster Dash\media\leaf.jpg",84
scale object 103,80,60,30
texture object 103,84
position object 103,230,10,360
make object collision box 103,-25,-35,-25,25,35,25,0
REM OBJECT tornado
make object cone 104,50
load image "E:\Disaster Dash\media\tornado.jpg",85
scale object 104,125,100,100
texture object 104,85
position object 104,300,10,550
make object collision box 104,-25,-35,-25,25,35,25,0
xrotate object 104,180
yrotate object 104,100
zrotate object 104,0
rem make object sphere 83,50
rem Scale object 83,100,90,90
rem xrotate Object 83,90
rem yrotate object 83,30
rem zrotate object 83,0
rem make mesh from object 1,83
rem delete object 99
rem By playing with the limb scale I am attempting to get the can cover correctly aligned with the can. Orignal values :100,0,100
rem add limb 1,1,1
rem link limb 1,0,1
rem offset limb 1,1,-1,25,-8
rem original scale values: 100,0,100
rem scale limb 1,1,98,0,75
rem remtexture limb 1,1,83
rem Load bike
obj=5+(c*100)
rem if c=0 then load object "media\bike\bike.x",obj
rem if c=1 then load object "media\bike\bike2.x",obj
rem position object obj,256,2,500
rem scale object obj,1000,1000,1000
rem rotate object obj,0,180,0
rem fix object pivot obj
rem rotate object obj,0,0,0
rem set object light obj,0
rem Create shadow for bike
rem make object plain obj+2,256,256
rem load image "media\bike\shadow.bmp",obj+2
rem scale object obj+2,15,15,15
rem texture object obj+2,obj+2
rem xrotate object obj+2,90
rem ghost object on obj+2,1
rem set object light obj+2,0
rem next c
rem Create ten trees for road
set image colorkey 0,0,0
load image "media\world\tree.bmp",501
for tr=1 to 1000
make object plain 500+tr,128,128
r=rnd(1)
if r=0 then position object 500+tr,160-rnd(400),64,51*(100+rnd(150))
rem if r=1 then position object 500+tr,370+rnd(400),64,51*(100+rnd(150))
texture object 500+tr,501
set object 500+tr,1,1,1
set object cull 500+tr,0
next tr
rem Setup camera, light
set point light 0,256,300,256
set camera fov 120
rotate camera 0,0,0
set ambient light 50
position camera 5,3000,3000
rem Load bike sound
rem load 3dsound "media\sounds\car.wav",1 : position sound 1,30000,30000,30000 : loop sound 1
rem load music "media\sounds\music.mp3",1 : loop music 1
rem Init bike variables
carx#=240
ss#=100
rem Main loop
do
print "meters Left: ";(MyTimer/60)+1
position object 101,object position x (101),object position y (101),camera position z ()+100
if keystate(203)=1
bl#=object position x(101)
dec bl#,5
position object 101,bl#,object position y(101),object position z(101)
endif
if keystate(205)=1
bl#=object position x(101)
inc bl#,5
position object 101,bl#,object position y(101),object position z(101)
endif
rem bike control
carx#=wrapvalue(carx#+1.0)
rem Move on road
roadz#=roadz#+7.0
side#=wrapvalue(side#+0.3)
if roadz#>=512.0
rem move camera back
roadz#=roadz#-512.0
rem trees as relative
for tr=1 to 10
position object 500+tr,object position x(500+tr),64,object position z(500+tr)-512
next tr
endif
position camera 256+(sin(side#)*10),12+(cos(side#)*5),roadz#+(sin(side#)*20)
xrotate camera 10
rem Position main light
position light 0,200,800,roadz#
rem Make third matrix rise up over time
position matrix 8,0,-2+(((512-roadz#)/10.0)*-1),512*7
rem Keep sky and mountains in place
position object 1,256,15,roadz#
position object 4,256,400,roadz#+(4684)
yrotate object 1,wrapvalue(object angle y(1)-0.1)
rem Keep bike in place
for c=0 to 1
rem Position bike and parts
rem if c=0
rem position object 5+(c*100),240+cos(carx#)*8,0,roadz#+35+(sin(ss#*15)*5)
rem position object 7+(c*100),240+cos(carx#)*8,0.25,roadz#+35+(sin(ss#*15)*5)
rem else
rem position object 5+(c*100),270-cos(carx#)*8,0,roadz#+35+(cos(ss#*15)*5)
rem position object 7+(c*100),270-cos(carx#)*8,0.5,roadz#+35+(cos(ss#*15)*5)
rem endif
rem zrotate object 5+(c*100),cos(carx#)*4
rem Rotate bike wheels
heada#=wrapvalue(heada#+2)
rem if limb exist(5+(c*100),1)=1
rem t=7 : rotate limb 5+(c*100),t,0,wrapvalue(cos(heada#)*20),0
rem t=3 : rotate limb 5+(c*100),t,wrapvalue(limb angle x(5+(c*100),t)-35),0,0
rem t=5 : rotate limb 5+(c*100),t,wrapvalue(limb angle x(5+(c*100),t)-35),0,0
rem endif
next c
rem Move trees and wrap them
for tr=1 to 10
rem move tree
position object 500+tr,object position x(500+tr),64,object position z(500+tr)-15
rem wrap tree
if object position z(500+tr)<-512
r=rnd(1)
if r=0 then position object 500+tr,160-rnd(400),64,51*(100+rnd(150))
if r=1 then position object 500+tr,370+rnd(400),64,51*(100+rnd(150))
endif
next tr
rem Move mountains closer and closer
if ss#<150 then ss#=ss#+0.05
scale object 4,ss#,ss#,ss#
rem Set sound position for bike
rem position listener 256,5+(cos(side#)*5),roadz#+(sin(side#)*35)
rem position sound 1,carx#,0,roadz#+35
rem scale listener 0.25
rem Move strap line
rem gosub _control_strap
Rem Collision
for x = 1 to 102
if object collision (101,102)>0
Gosub lose
`Delete object
exclude object on 102
endif
next x
backdrop off
for x = 1 to 103
if object collision (101,103)>0
Gosub lose
`Delete object
exclude object on 103
endif
next x
backdrop off
for x = 1 to 104
if object collision (101,104)>0
Gosub lose
`Delete object
exclude object on 104
endif
next x
backdrop off
rem Check Timer
if MyTimer = 0 : rem If the game is over
for x = 1 to 100 : rem Check all the game object
if object exist(x) = 1 then delete object x
next x
backdrop off
gosub EndSection:
endif
if MyTimer > 0 then MyTimer = MyTimer - 1 : rem Timer countdown
Rem Collision
for x = 1 to 102
if object collision (101,102)>0
Gosub EndSection
`Delete object
exclude object on 102
endif
next x
backdrop off
rem Check Timer
if MyTimer = 0 : rem If the game is over
for x = 1 to 100 : rem Check all the game object
if object exist(x) = 1 then delete object x
next x
backdrop off
gosub EndSection:
endif
if MyTimer > 0 then MyTimer = MyTimer - 1 : rem Timer countdown
rem Update screen
sync
rem Endloop
loop
level2:
EndSection:
REM DECLARE VARIABLES
REM SCREEN DISPLAY
cls 0
for x=1 to 85
if object exist(x) =1 then delete object x
next x
backdrop off
for t =1 to NumberOfFruits
if object exist(t) =1 then delete object t
next t
backdrop off
center text 320,240,"Go to next level? [Y/N]?"
if MyScore <=2999 then print "Yay! Now for the next level"
REM SOUND EFFECTS
rem stop sound 1
rem play sound 2
REM SPECIAL EFFECTS
REM REFRESH SCREEN
sync
REM *** END SECTION LOOP
do
if scancode()=0 then exit
loop
do
REM CONTROL INPUT
if Inkey$()="y"
rem loop sound 1
gosub level2
endif
if Inkey$()="n"
cls : end
endif
REM REFRESH SCREEN
sync
loop
lose:
REM DECLARE VARIABLES
REM SCREEN DISPLAY
cls 0
for x=1 to 85
if object exist(x) =1 then delete object x
next x
backdrop off
for t =1 to NumberOfFruits
if object exist(t) =1 then delete object t
next t
backdrop off
center text 320,240,"want to try again? [Y/N]?"
if MyScore <=2999 then print "You lost"
REM SOUND EFFECTS
rem stop sound 1
rem play sound 2
REM SPECIAL EFFECTS
REM REFRESH SCREEN
sync
REM *** END SECTION LOOP
do
if scancode()=0 then exit
loop
do
REM CONTROL INPUT
if Inkey$()="y"
rem loop sound 1
gosub mainsection:
endif
if Inkey$()="n"
cls : end
endif
REM REFRESH SCREEN
sync
loop
end
rem Demo Subroutines
rem _create_strap:
rem load image "media\gfx\prompt.bmp",2
rem load image "media\gfx\strapblank.bmp",3
rem strapx1=0 : sprite 1,strapx1,480-63,2
rem strapx2=1024 : sprite 2,strapx2,480-63,2
rem set sprite alpha 1,196 : set sprite alpha 2,196
rem return
rem _control_strap:
rem dec strapx1 : if strapx1<=-1024 then strapx1=strapx2+1023
rem dec strapx2 : if strapx2<=-1023 then strapx2=strapx1+1024
rem sprite 1,strapx1,screen height()-63,2
rem sprite 2,strapx2,screen height()-63,3
rem return
In carbonade how do you make it so when you touch the steps the game is over and you lose