How best to determine with a sprite has been pushed off-screen?

55 views Asked by At

I'm developing a Flappy Bird clone (for learning purposes only!), but am a little confused when trying to detect when the bird has been pushed off-screen.

My plan was something akin to

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

However, this doesn't work as the bird (when hitting the left edge of the frame) seems to have a position.x of about (but not exactly) 270.

Am I going about this the wrong way?

0

There are 0 answers