【问题标题】:game maker two player same screen move between rooms issue游戏制作者两个玩家同一屏幕在房间之间移动问题
【发布时间】:2016-04-24 17:01:40
【问题描述】:

我目前正在学习游戏制作。我从不同的在线教程中制作了一个简单的 2d 自上而下 hack 和斜线小游戏。我使用 360 控制器添加了第二个玩家并开始创建新关卡。我遇到的问题是将两个玩家都搬到一个新房间。我在检查玩家是否触摸门然后将他们移动到新房间的对象门上发生碰撞。但是,当玩家移动房间时,其他玩家不会与他们一起移动到相同的位置。

///door object collision

if (room_exists (other.new_room))
{
    room_goto(other.new_room);
    x = other.newx;
    y = other.newy;

}


///creation code on the door in the map 

new_room = rm2;

newx = 64;
newy = 34;

有没有办法将 obj_player2 分配到新房间以及使用相同的位置?

【问题讨论】:

    标签: game-maker


    【解决方案1】:

    我假设两个玩家对象都是持久的,这是玩家 1 的碰撞事件。

    您只是将新位置分配给玩家 1,只需对玩家 2 执行相同操作即可。

    if (room_exists (other.new_room))
    {
        x = other.newx;
        y = other.newy;
    
        obj_player2.x = other.newx;
        obj_player2.y = other.newy;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-08-14
      • 2020-06-09
      • 1970-01-01
      • 2021-08-18
      • 1970-01-01
      • 2011-11-23
      • 1970-01-01
      相关资源
      最近更新 更多