|
تشخيص برخورد در gm
|
|
|
|
|
|
|
|
|
|
|
|
|
|
نويسنده |
پيغام |
Ali مدیر کل
تاريخ عضويت: شنبه 20 تير 1383 تعداد ارسالها: 2984 محل سكونت: On the edge
1 شنبه 6 شهريور 1384 - 23:51 |
|
|
برای اینکه دو تا جسم موقع برخورد توی هم نرن باید یکی از اجسام یا هر دو تا ( بسته به نوع استفاده ) از نوع solid باشن... برای اینکار میتونین از خاصیت solid = true or false در جایی که لازمه استفاده کنید... مثلا وقتی بک بلوک ایجاد میشه و در حال سقوطه جامد نیست ولی وقتی به انتهای صحنه بازی میرسه و سرعتش صفر میشه دارای خصوصیت solid میشه تا بلوک بعدی که داره سقوط میکنه اونرو به عنوان یک جسم جامد بشناسه و روش وایسته...
برای تشخیص برخورد هم میتونید از دستورات تشخیص برخورد GM مثل
move_bounce_solid(adv)
Bounce against solid instances, like the corresponding action. adv indicates whether to use advance bounce, that also takes slanted walls into account.
move_bounce_all(adv)
Bounce against all instances, instead of just the solid ones.
move_contact_solid(dir,maxdist)
Move the instance in the direction until a contact position with a solid object is reached. If there is no collision at the current position, the instance is placed just before a collision occurs. If there already is a collision the instance is not moved. You can specify the maximal distance to move (use a negative number for an arbitrary distance).
move_contact_all(dir,maxdist)
Same as the previous function but this time you stop at a contact with any object, not just solid objects.
move_outside_solid(dir,maxdist)
Move the instance in the direction until it no longer lies within a solid object. If there is no collision at the current position the instance is not moved. You can specify the maximal distance to move (use a negative number for an arbitrary distance).
move_outside_all(dir,maxdist)
Same as the previous function but this time you move until outside any object, not just solid objects.
و اینها :
place_free(x,y)
Returns whether the instance placed at position(x,y) is collision-free. This is typically used as a check before actually moving to the new position.
place_empty(x,y)
Returns whether the instance placed at position (x,y) meets nobody. So this function takes also non-solid instances into account.
place_meeting(x,y,obj)
Returns whether the instance placed at position (x,y) meets obj. obj can be an object in which case the function returns true is some instance of that object is met. It can also be an instance id, the special word all meaning an instance of any object, or the special word other.
استفاده کنید... |
_________________ پی سی گیمرز - آرشيو بزرگ بازی های کامپیوتری |
|
بازگشت به بالا |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
صفحه 1 از 1 |
تمام ساعات و تاريخها بر حسب 3.5+ ساعت گرينويچ مي باشد
|
|
شما نمي توانيد در اين انجمن نامه ارسال كنيد. شما نمي توانيد به موضوعات اين انجمن پاسخ دهيد شما نمي توانيد نامه هاي ارسالي خود را در اين انجمن ويرايش كنيد شما نمي توانيد نامه هاي ارسالي خود را در اين انجمن حذف كنيد شما نمي توانيد در نظر سنجي هاي اين انجمن شركت كنيد
|
|
|