Hi eek,
It seems that if you create your matrix BEFORE you run your initialization and set your camera position, it will not affect said camera position.
I added the matrix near the top of your source. Of course, you'll want to size and position it appropriately:
`Block Positions
DIM blockPos(2,2)
blockPos(1,1)=0
blockPos(1,2)=10
blockPos(2,1)=0
blockPos(2,2)=5
sync on
hide mouse
autocam off
rem if you add the matrix first, when
rem you reposition your camera later,
rem that camera position won't be interfered with.
rem It seems strange because you have autocam set
rem off. DBC just seems to work this at least
rem when it comes to matrices
make matrix 10, 50.0, 50.0, 50, 50
position matrix 10,-20,0,-20
gosub initialisation:
Do
gosub displayElements:
gosub playerControl:
gosub ball:
sync
Loop
initialisation:
`camera
position camera 0,25,0
point camera 0,0,0
`Paddle
make object box 1,1,1,3
color object 1,rgb(155,0,0)
yrotate object 1,90
`ball
make object sphere 2,1
color object 2,rgb(0,0,255)
set object collision to spheres 2
`walls
make object box 50,1,1,32
position object 50,-17,0,0
set object collision to boxes 50
make object box 51,1,1,32
position object 51,17,0,0
set object collision to boxes 51
make object box 52,34,1,1
position object 52,0,0,15
set object collision to boxes 52
rem level
For t = 10 to 11
make object box t,1,1,3:color object t,rgb(0,255,0)
YRotate Object t,90
position object t,blockPos(t-9,1),0,blockPos(t-9,2)
set object collision to boxes t
Next t
`Necessary Variables
balla#=175
Score=0
return
displayElements:
set cursor 65,20
Print "Score: ", Score
return
playerControl:
rem paddle movement
IF rightkey()=1 and player1pos#<15 then player1pos#=player1pos#+0.5
IF leftkey()=1 and player1pos#>-15 then player1pos#=player1pos#-0.5
position object 1,player1pos#,0,-13
return
ball:
`Ball Movement
ballx#=newxvalue(ballx#,balla#,0.3):ballz#=newzvalue(ballz#,balla#,0.3)
`Bouncing
if ballx#>4 and ballx#<4 and ABS(player1pos#-ballz#)<1.5 then balla#=360-balla#
if ballx#<-4 and ballx#>-4 and ABS(player2pos#-ballz#)<1.5 then balla#=360-balla#
if ballz#>14 or ballz#<-12 then balla#=180-balla#
if ballx#>16 or ballx#<-16 then balla#=180-balla#
rem MAKE SURE balla# IS LESS THAN 360 AND MORE THAN 0
balla#=wrapvalue(balla#)
position object 2,ballx#,0,ballz#:yrotate object 2,balla#
`Ball to box collision
For C = 10 to 11
If object collision(2,0)=c
balla#=wrapvalue(balla#+180)
` delete object C
Hide object C
set object collision off C
endif
Next C
return
Enjoy your day.