I am using the Turtle module for Python and am making a fairly simple game. I started to code for Border checking and am following a video to do it, but it doesn't seem to work. I had used the same code in the past and it was fine but now nothing happens.
The Code:
Border Limitations
global player
if player.xcor() > 600 or player.xcor() < -600:
    player.right(180)   
if player.ycor() > 400 or player.ycor() < -400:
    player.right(180)
I believe you should put that inside the main game-loop, instead of a function, cross out the global.
Why does xcor and ycor not work for my border check?