简体   繁体   English

当Game Maker Studio中的碰撞停止时,如何停止更改实例?

[英]how to stop change instance when collision stops in game maker studio?

Collision Event with object obj_cu:

for all obj_lamp: change the instance into object obj_lamo_light, not performing events
for all obj_arrow: change the instance into object obj_arrow_move, not performing events

where obj_lamo_light contains 3 sub iamges and obj_Arrow_move contains 3 sub images and I want to change them back to original objects when collision stops 其中obj_lamo_light包含3个子图像,而obj_Arrow_move包含3个子图像,当碰撞停止时,我想将它们更改回原始对象

In the obj_lamp_light event, you could check whether or not your collision is still occurring, and change back if not. 在obj_lamp_light事件中,您可以检查是否仍在发生碰撞,如果不是,请返回。

if (collision_rectange(x, y, x + sprite_width, y + sprite_width, false, true) == noone)
{
    instance_change(obj_lamp, false);
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM