Hi,
I try that when I click (left mouse button) ,at that position a earth entity
Will be create. I make function for this and call it in main ().But it can’t work.
Why?Please help.
Here is my code.
ENTITY* earth;
var a;
var b;
var c;
function main()
{
level_load("ent_.wmb");
wait(2);
mouse_mode = 2;
creat();
while(1)
{
mouse_pos.x = mouse_cursor.x;
mouse_pos.y = mouse_cursor.y;
wait (1);
}
}
function creat()
{
if (event_type == EVENT_CLICK)
{
while (mouse_left)
{
a = mouse_pos.x; // follow mouse x-pos
b = mouse_pos.y; // follow mouse y-pos
c = camera.z; // same as camera z-pos
earth = ent_create("earth.mdl",vector(a,b,camera.z), NULL);
wait(1);
}
}
}