Hi
I am practising a little on useing the camera commands and some other stuff, so I'm making a test program for fun.
But there is some problems with the camera.
When I run it with THIS code:
gosub sync_settings
gosub make_box
gosub make_matrix
gosub the_loop
sync_settings:
sync on
sync rate 60
return
make_box:
make object box 1,5,5,5
color object 1, rgb(255,255,255)
position object 1,0,0,0
return
make_matrix:
make matrix 1,500,500,50,50
position matrix 1,-250,-3,-100
return
the_loop:
do
pay#=object angle y(1)
position camera object position x(1), object position y(1), object position z(1)
rotate camera 0,pay#,0
move camera -5
position camera camera position x(),camera position y()+2,5,camera position z()
point camera object position x(1),object position y(1),object position z(1)
set cursor 0,0
print scancode()
if keystate(200)
move object 1,1
endif
if keystate(208)
move object 1,-1
endif
if keystate(203)
turn object left 1,2
endif
if keystate(205)
turn object right 1,2
endif
sync
loop
There occours an error when I'm turning the box, and then moveing it.
In other words, I can only move the box forwards. Else it tells me:
Camera number illegal at line 31
OR
Camera does not exist at line 31.
I'm lost on that one.
Then I try and make a camera number 1, and that makes the code look like this:
gosub sync_settings
gosub make_box
gosub make_matrix
gosub the_camera
gosub the_loop
sync_settings:
sync on
sync rate 60
return
make_box:
make object box 1,5,5,5
color object 1, rgb(255,255,255)
position object 1,0,0,0
return
make_matrix:
make matrix 1,500,500,50,50
position matrix 1,-250,-3,-100
return
the_camera:
make camera 1
return
the_loop:
do
pay#=object angle y(1)
position camera 1, object position x(1), object position y(1), object position z(1)
rotate camera 1, 0,pay#,0
move camera 1, -5
position camera 1, camera position x(1),camera position y(1)+2,5,camera position z(1)
point camera 1, object position x(1),object position y(1),object position z(1)
set cursor 0,0
print scancode()
if keystate(200)
move object 1,1
endif
if keystate(208)
move object 1,-1
endif
if keystate(203)
turn object left 1,2
endif
if keystate(205)
turn object right 1,2
endif
sync
loop
But then i can't even run the code.
It says:
Parameter for "POSITION CAMERA" do noy match "X, Y, Z" at line 36.
Can someone help me?
[EDIT
] Using DBPro