Hi, thought I might add my 2 pence worth here.
@Dark basic dude79
Your last bit of code does work but the dot starts in the top left of the screen and moves off diagnolly upward and to the right.
Change the starting value of y# to 300 and you'll see a diagnol line being drawn (i.e. multiple dots as you're not deleting the previous dots).
However, I wouldn't use the newxvalue and newyvalue commands in 2D, as far as I know they're designed to be used within the 3D evironment coordinate system (but someone else may know more than me on this).
Back to your original dilema regading camera position and such, I'm having a bit of trouble understanding what you want.
Are you looking for a type of 3rd person camera view, whereby you control an object and the camera follows it?
`camera follows box
sync on
sync rate 65
autocam off
hide mouse
make matrix 1,3000,3000,10,10
make object box 1, 10,5,20
do
if upkey() = 1 then move object 1, 5
if rightkey() = 1 then inc yang
if leftkey() = 1 then dec yang
yrotate object 1, yang
set camera to follow object position x(1), object position y(1), object position z(1), yang, 50, 20, 5, 0
text 1,1, "use arrow keys to move box"
sync
loop
Or are you wanting to point the camera in a particular direction and move an object out in the direction the camera is pointing, but the camera itself doesn't move?
`move mouse left and right to rotate camera
`LMB to shoot
sync on
sync rate 65
autocam off
hide mouse
make matrix 1,3000,3000,10,10
make object box 1, 10,6,30
yang = 0
do
yang = yang + mousemovex()
yrotate object 1, yang
if shoot = 0
position object 1, 1500, 3, 0
position camera object position x(1), object position y(1)+20, object position z(1)
yrotate camera yang
move camera -50
else
move object 1, 10
endif
if mouseclick() = 1
shoot = 1
endif
if spacekey() = 1 then shoot = 0
text 1,1, "move mouse left and right and press LMB to shoot"
if shoot = 1 then text 1,30, "PRESS SPACE TO RESET"
sync
loop
I've used the method DVader described for positioning the camera.
Hope one of these helps.
I've just reread through the posts and I think you want the first code snippet but I'll leave the second snippet now I've written it.