For some reason, my coding won't allow that to happen, unless i'm doing it wrong...
rem Setup global stuff
set display mode 640,480,32
hide mouse
autocam off
color backdrop rgb(0,0,0)
rem Hide loading
sync on
sync rate 0
sync
center text 320,240,"LOADING"
sync
lvl=1
rem Make textures
set image colorkey 255,0,255
load bitmap "D:Program FilesThe Game CreatorsDark Basic ProfessionalProjectsTexturesblock - break1.bmp",1
get image 1,0,0,32,32
delete bitmap 1
load bitmap "D:Program FilesThe Game CreatorsDark Basic ProfessionalProjectsTexturesblock - break2.bmp",2
get image 2,0,0,32,32
delete bitmap 2
Load bitmap "D:Program FilesThe Game CreatorsDark Basic ProfessionalProjectsTexturesblock - break3.bmp",3
get image 3,0,0,32,32
delete bitmap 3
load bitmap "D:program filesthe game creatorsdark basic professionalprojectstexturesblock.bmp",4
get image 4,0,0,32,32
Delete bitmap 4
load bitmap "D:Program FilesThe Game CreatorsDark Basic ProfessionalProjectsTexturessafe block.bmp",5
Get image 5,0,0,32,32
delete bitmap 5
load bitmap "D:Program FilesThe Game CreatorsDark Basic ProfessionalProjectsTexturesend block.bmp",6
get image 6,0,0,32,32
delete bitmap 6
cls
setup:
rem Start off variables
PlayerX#=10.0
PlayerY#=75.0
PlayerZ#=10.0
PlayerGrav#=0.5
PlayerargetAng#=0.0
PlayerSpeed#=0.5
dim BoxLife(100)
dim BoxTriggered(100)
rem Make player
make object sphere 1,5
color object 1,rgb(0,255,0)
make object collision box 1,-1.5,5,-1.5,1.5,5,1.5,0
rem Make level 1
Obj=2
sobj=200
fobj=300
for y=10 to 1 step -1
for x=1 to 10
read LevelData1
if LevelData1=1
make object box Obj,10,10,10
position object Obj,x*10,0,y*10
texture object Obj,4
make object collision box Obj,-5,-5,-5,5,5,5,0
BoxLife(Obj)=300
BoxTriggered(Obj)=0
inc Obj,1
endif
`make safe blocks
if leveldata1=2
make object box sobj,10,10,10
position object sobj,x*10,0,y*10
make object collision box sobj,-5,-5,-5,5,5,5,0
texture object sobj,5
inc sobj,1
endif
`make finish block
if leveldata1=3
make object box fobj,10,10,10
position object fobj,x*10,0,y*10
make object collision box fobj,-5,-5,-5,5,5,5,0
texture object fobj,6
inc fobj,1
endif
next x
next y
rem Lock frame rate
sync on
sync rate 100
rem Start the main loop
do
rem Take input
Up=upkey()
Down=downkey()
Right=rightkey()
Left=leftkey()
rem Control player
if Up=1 and Left=0 and Right=0
PlayerZ#=PlayerZ#+PlayerSpeed#
PlayerTargetAng#=camera angle y()
endif
if Up=1 and Left=1 and Right=0
PlayerZ#=PlayerZ#+(PlayerSpeed#/2)
PlayerX#=PlayerX#-(PlayerSpeed#/2)
PlayerTargetAng#=camera angle y()-45
endif
if Up=1 and Left=0 and Right=1
PlayerZ#=PlayerZ#+(PlayerSpeed#/2)
PlayerX#=PlayerX#+(PlayerSpeed#/2)
PlayerTargetAng#=camera angle y()+45
endif
if Down=1 and Left=0 and Right=0
PlayerZ#=PlayerZ#-PlayerSpeed#
PlayerTargetAng#=camera angle y()+180
endif
if Down=1 and Left=1 and Right=0
PlayerZ#=PlayerZ#-(PlayerSpeed#/2)
PlayerX#=PlayerX#-(PlayerSpeed#/2)
PlayerTargetAng#=camera angle y()-135
endif
if Down=1 and Left=0 and Right=1
PlayerZ#=PlayerZ#-(PlayerSpeed#/2)
PlayerX#=PlayerX#+(PlayerSpeed#/2)
PlayerTargetAng#=camera angle y()+135
endif
if Right=1 and Up=0 and Down=0
PlayerX#=PlayerX#+PlayerSpeed#
PlayerTargetAng#=camera angle y()+90
endif
if Left=1 and Up=0 and Down=0
PlayerX#=PlayerX#-PlayerSpeed#
PlayerTargetAng#=camera angle y()-90
endif
PlayerAng#=curveangle(wrapvalue(PlayerTargetAng#),PlayerAng#,20)
PlayerAng#=wrapvalue(PlayerAng#)
PlayerY#=PlayerY#-PlayerGrav#
rem Update player object
position object 1,PlayerX#,PlayerY#-10,PlayerZ#
if object collision(1,0)>0
PlayerY#=PlayerY#+PlayerGrav#
endif
rem Blow up blocks
for b=2 to Obj-1
if object exist(b)=1
if object collision(b,1)>0
BoxTriggered(b)=1
endif
if BoxTriggered(b)=1
BoxLife(b)=BoxLife(b)-1
endif
if BoxLife(b)<300 and BoxLife(b)>199
texture object b,1
endif
if BoxLife(b)<200 and BoxLife(b)>99
texture object b,2
endif
if BoxLife(b)<100
texture object b,3
endif
if BoxLife(b)<1
delete object b
endif
endif
next b
`If on finish block make sure all other blocks are destroyed
If object collision(300,1)=1
NumObjExisting = 0
For N=2 To 199
Inc NumObjExisting, Object Exist(N)
Next N
If NumObjExisting = 0
ink rgb(255,0,0),0
center text 320,240,"FINISHED!"
gosub clear
Endif
Endif
rem Update player object
position object 1,PlayerX#,PlayerY#,PlayerZ#
yrotate object 1,PlayerAng#
rem Control camera
position camera 35,60,-30
point camera PlayerX#,PlayerY#,PlayerZ#
rem Update the screen
sync
rem End the loop
loop
rem Design level
LevelData1:
data 0,0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0,0
data 2,2,0,0,2,2,0,0,0,0
data 2,2,1,1,2,2,0,0,0,0
data 0,1,0,0,1,0,0,0,0,0
data 0,1,0,0,1,0,0,0,0,0
data 2,2,1,1,2,2,0,0,0,0
data 2,2,0,0,3,3,0,0,0,0
LevelData2:
data 0,0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0,0
data 3,1,1,2,0,0,0,0,0,0
data 1,0,0,1,0,0,0,0,0,0
data 1,0,0,1,0,0,0,0,0,0
data 2,1,1,2,0,0,0,0,0,0
data 1,1,1,1,0,0,0,0,0,0
data 1,0,0,1,0,0,0,0,0,0
data 2,1,1,2,0,0,0,0,0,0
LevelData3:
data 0,0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0,0
data 2,0,0,0,0,0,0,0,0,0
dunno whats going wrong but it just won't have it ; ;
and i know my coding is a mess but i'm just trying to get the parts to work first
I can see from your smile, you're not here for the sunset.