cameraoffsety track if the keys to move the camera are being held downcameraup false cameradown false cameraleft false cameraright false more variables are set at the start of playing level the mapwidth and mapheight variables are the size of the maps in pixels the expression for calculating mapheight is bit complicated since the tiles overlap each other only the bottom row of tiles is the full height (which accounts for the tileheight part of the expression)all of the other rows of tiles (which number as (len(mapobj[ ] )are slightly overlapped this means that they are effectively each only (tileheight tilefloorheightpixels tall the camera in star pusher can be moved independently of the player moving around the map this is why the camera needs its own set of --moving|variablescameraupcameradowncameraleftand cameraright the cameraoffsetx and cameraoffsety variables track the position of the camera while truemain game loop reset these variablesplayermoveto none keypressed false for event in pygame event get()event handling loop if event type =quitplayer clicked the "xat the corner of the window terminate(the playermoveto variable will be set to the direction constant that the player intends to move the player character on the map the keypressed variable tracks if any key has been pressed during this iteration of the game loop this variable is checked later when the player has solved the level elif event type =keydownhandle key presses keypressed true if event key =k_leftplayermoveto left elif event key =k_rightplayermoveto right elif event key =k_upemail questions to the authoral@inventwithpython com