0

我正在开发 Flappy Bird 克隆(仅用于学习目的!),但在尝试检测鸟何时被推离屏幕时有点困惑。

我的计划类似于

if bird.position.x < 0 {
    // Bird is off screen, game over
}

但是,这不起作用,因为鸟(当击中框架的左边缘时)似乎有一个 position.x 大约(但不完全是)270。

我会以错误的方式解决这个问题吗?

4

0 回答 0