Hello one and all
What is the best way to move an object to a new X Y pos by moving the mouse and clicking a spot on a map and having the the object move to that pos.?
I have a plane that the camera is looking vert. down on. I have objects planes texture with 2d sprites and need to move the around.
here is the code I have so far.
Rem ***** Main Source File *****
sync on
sync rate 60
camx# = 130.0
camy# = 500.0
camz# = -550.0
autocam off
position camera camx#, camy#, camz#
point camera camx#, camy#, camz# : rem pointing straight down!
set ambient light 50
make light 1
make object plain 4,16,16
LOAD IMAGE "test1.bmp", 4,1
texture object 4,4
position object 2,130,460,-1
make object plain 2,16,16
LOAD IMAGE "solder 2.bmp", 2,1
texture object 2,2
position object 2,130,500,-1
make object plain 3,16,16
LOAD IMAGE "solder 1.bmp", 3,1
texture object 3,3
position object 3,130,480,-1
make object plain 1,2500,2500
load image "cwbg2.bmp",1
texture object 1,1
do
if upkey() then inc camy#,1.0
if downkey() then dec camy#,1.0
if leftkey() then dec camx#,1.0
if rightkey() then inc camx#,1.0
if inkey$() = "a" then inc camy#,1.0
if inkey$() = "z" then dec camy#,1.0
if camx# > 800.0 then camx# = 800.0
if camx# < -800.0 then camx# = -800.0
if camy# > 913.0 then camy# = 913.0
if camy# < -900.0 then camy# = -900.0
`controls
`We'll want to be able to control the camera, so we'll do that here.
control camera using arrowkeys 0,1,1
`The way the pick object command works, is you'll want to set something eqaul to it.
`In this case we use "p" (For pick if you didn't guess.

), so we can identify
`whatever object is picked with p.
`To find out which object we're picking, we'll use the mousex() and mousey() commands
`in the first two spaces for the pick object command. After that, we put the range of
`objects we'll be using. In this case we have five objects, so our range is 0-5.
`If you had 500 objects, it would be 0-500. Or maybe you only want to select the first
`100, then 0-100. In any case, the last two spaces for syntax are for the objects you
`want to pick.
`(**NOTE This is a handy place to put variables if you'll be periodically be
`creating objects.**)
p=pick object(mousex(),mousey(),2,4)
set cursor 0,0
`If p isn't picked, this is what we'll do. We'll say nothing is picked
`and color all the objects white.
if p=0
print "No objects selected"
for a = 1 to 5
next a
`If an object is picked, we'll print which one is picked, and color it yellow.
else
print "Object ";p;" is selected."
endif
sync
position camera camx#,camy#,camz#
loop
I am going to have many sprites plane objects and I want to be able to move then around the map. Once I pick one and it strat to move to a new pos. I want to be able to go to the next object and move it while the other object is still moving to the new pos.
Tanks you renny