Ali مدیر کل
تاريخ عضويت: شنبه 20 تير 1383 تعداد ارسالها: 2983 محل سكونت: On the edge
5 شنبه 9 مهر 1383 - 13:34 |
|
|
اصغر جان
اين كل كدي است كه من در بازي از آن استفاده كرده ام :
كد: |
if(instance_exists(obj_stop) && instance_exists(moving))
{
if(obj_stop.x < what.x && obj_stop.y < what.y && moving.x > what.x && moving.y > what.y)
{select = true;}
if(obj_stop.x > what.x && obj_stop.y > what.y && moving.x < what.x && moving.y < what.y)
{select = true;}
if(obj_stop.x > what.x && obj_stop.y < what.y && moving.x < what.x && moving.y > what.y)
{select = true;}
if(obj_stop.x < what.x && obj_stop.y > what.y && moving.x > what.x && moving.y < what.y)
{select = true;}
} |
كد: |
if (mouse_check_button(mb_left) && instance_exists(obj_stop) && instance_exists(moving))
{pen_color = 255;
draw_line(obj_stop.x,obj_stop.y,moving.x,obj_stop.y);
draw_line(obj_stop.x,obj_stop.y,obj_stop.x,moving.y);
draw_line(moving.x,obj_stop.y,moving.x,moving.y);
draw_line(obj_stop.x,moving.y,moving.x,moving.y);
} |
كد: |
if (mouse_check_button(mb_left) )
{if(instance_number(obj_stop) = 0)
{instance_create(mouse_x,mouse_y,obj_stop);
}
if(instance_number(moving) = 0)
{instance_create(mouse_x,mouse_y,moving);
}
}
else
{with (obj_stop) instance_destroy();
with (moving) instance_destroy();
} |
اميدوارم كه اين يكي ديگه كمك كنه
موفق باشيد
علي |
_________________ پی سی گیمرز - آرشيو بزرگ بازی های کامپیوتری |
|