Hi Gnometech !
Thanks for the information. This morning, I looked at another of your messages
where you responded to Frederic about Vertors. So I went back and
Code:
//The correct code follows below:
ENTITY* quest1j2;
VECTOR* tempj2 = {x=0;y=0;z=0;}
/////////////
var enable_polycollision = 0; //is set in main.c before function main()
////////////
int valeurclic = 0;
function bougequest1j2 () // August 1st 2007
{
wait(1);
valeurclic += 1;
if ( (valeurclic % 2) == 1) // The left side of mouse was selected
{
while (mouse_left == 1) {wait (1);}
while (mouse_left == 0)
// move the object until the player presses the mouse button again
{
vec_set (tempj2, vector(mouse_cursor.x,mouse_cursor.y,500));
vec_for_screen(tempj2, camera); // voir manuel
vec_set (quest1j2.x,tempj2.x);
wait (1);
}
}
else // drop the object
{
vec_set (tempj2.x, quest1j2.x);
quest1j2.z += 50; // drop the object 50 quants
c_move(quest1j2,nullvector,nullvector,
IGNORE_MAPS | IGNORE_CONTENT | ACTIVATE_TRIGGER | USE_AABB );
}
}
So your comments about Vectors was the answer.
Now the code is shorter
As for the nullvector for the movement...the box (with this code) drops
where I want it. It falls below the camera view and does a collision.
Ps: look at my flags at a glance table in Lite-C contribution.