Hi guys, I really hope i can get some help on this cause i've been searching for a while in vein for a solution.
Basically im trying to make a very simple maze game where you get the marble from one end to the next. the code is as follows;
randomize timer()
sync on
sync rate 0
dim grid(20,20)
`images to be used as textures
`load image "snow1.jpg",1
`load image "ice.jpg",2
`load image "mountain.jpg",3
`load image "sky.jpg",4
`Level Floor
make object plain 1,210,210
rotate object 1,90,0,0
position object 1,100,-5,100
`texture object 1,3
`scale object texture 1,7,7
`marble
make object sphere 4, 7
`sky sphere
make object sphere 5 ,-500
position object 5,100,100,0
`texture object 5,4
rotate object 5,180,0,0
`scale object texture 5,5,1
`camera work
make camera 1
position camera 1, 0,200,-100
rotate camera 1,50,0,0
`create maze
for y=1 to 20
for x=1 to 20
read grid(x,y)
next x
next y
wall=11
for x=1 to 20
for y=1 to 20
inc wall,1
if grid(x,y)=1
make object box wall,10,10,10
`texture object wall,2
position object wall,x*10,0,y*10
endif
next y
next x
sync
do
`variables
speed# = 0.1
acceleration# = 0.1
maxspeed = 1
if speed# >= maxspeed then maxspeed = maxspeed
`ball work
if upkey() = 1 then move object 4,speed#
if downkey() = 1 then move object 4,-0.5
if leftkey()=1 then move object left 4,0.5
if rightkey()=1 then move object right 4,0.5
sync
loop
`The maze layout
data 1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
data 1,1,1,1,0,0,1,1,0,0,0,1,1,1,0,0,0,1,1,1
data 1,0,0,1,1,0,1,1,0,1,0,1,1,1,0,1,0,0,0,1
data 1,1,0,1,1,0,0,0,0,1,0,0,1,1,0,1,0,1,0,0
data 1,1,0,0,0,1,1,1,1,1,1,0,1,0,0,0,0,1,1,1
data 1,0,1,1,0,1,0,0,0,0,0,0,1,0,1,1,0,1,1,1
data 1,0,0,0,0,0,0,1,1,1,1,1,1,0,1,1,0,0,0,0
data 1,1,1,0,1,1,0,0,0,1,1,0,0,0,0,1,1,1,1,1
data 1,0,0,0,1,1,1,1,0,1,1,0,1,1,0,0,0,0,1,1
data 0,0,1,1,0,1,0,0,0,1,1,0,1,1,0,1,0,1,1,1
data 1,1,1,1,0,1,0,1,0,0,0,0,1,1,0,1,0,1,1,1
data 1,1,1,1,0,0,0,1,1,1,0,1,1,0,0,1,0,1,1,1
data 0,0,0,1,1,1,0,1,1,1,0,1,1,0,1,1,0,1,0,1
data 1,1,0,1,1,1,1,0,1,1,0,1,1,0,1,1,0,1,0,0
data 1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,1
data 1,1,1,0,1,1,1,0,1,0,1,1,1,1,0,1,1,1,0,1
data 1,0,1,0,1,1,0,0,0,0,1,1,0,1,0,0,0,0,0,1
data 1,0,0,0,1,1,0,1,1,0,0,0,0,1,1,0,1,1,0,1
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1
The level is meant to be icey and i want the ball to gradually accelerate and then slow it self down once you stop pressing the up key. oh and for the ball to not go through the walls as well.
Any help would be greatly appreciated. Thanks
PS "rem'd" out the lines of code that ask for media so it should work as soon as its copied into Darkbasic