我一直在尝试编写一些 GML 脚本,但在某些时候完全卡住了。我希望敌人攻击我的主角,但不要重叠。所以,我会说。
//enemy is moving left-to-right...
if place_meeting(x+1, y, enemy){ //if there's a collision with another enemy
if (other enemy).is_attacking{ // ???
// checks if the colliding enemy is attacking, if true, it should attack as well...
is_attacking=true;
}else{
//walks
}
这是一张描述我想要得到的图像(请注意,敌人知道他们应该攻击,即使他们没有与主角直接接触,只是因为除此之外的敌人正在攻击)