Display.sync(60) will try to run your game at a constant frame rate of 60 fps. Its a method that you need to call once every frame (i.e. it should be in your game loop). Firstly the method calculates the amount of time it needs to sleep every frame (i.e. 1 second / 60 which is about 16 milliseconds) it then calculates the amount of time that has passed since the last time it was called, if the time passed is less than 16ms it then sleeps for the remainder of that time otherwise it does nothing.