camera than the camera slack should allow the camerax value needs to be updated so that the player squirrel is just at the edge of the camera slack this is why line sets camerax to playercenterx cameraslack half_winwidth note that the camerax variable is changednot the playerobj[' 'value we want to move the cameranot the player the other three if statements follow similar logic for the leftup and down sides drawing the backgroundgrasssquirrelsand health meter draw the green background displaysurf fill(grasscolorline begins the code that starts drawing the contents of the display surface object firstline draws green color for the background this will paint over all of the previous contents of the surface so that we can start drawing the frame from scratch draw all the grass objects on the screen for gobj in grassobjsgrect pygame rect(gobj[' 'cameraxgobj[' 'cameraygobj['width']gobj['height']displaysurf blit(grassimages[gobj['grassimage']]grectthe for loop on line goes through all the grass objects in the grassobjs list and creates rect object from the xywidthand height information stored in it this rect object is stored in variable named grect on line grect is used in the blit(method call to draw the grass image on the display surface note that gobj['grassimage'only contains an integer that is an index to grassimages grassimages is list of surface objects that contain all the grass images surface objects take up much more memory than just single integerand all the grass objects with similar gobj['grassimage'values look identical so it makes sense to only have each grass image stored once in grassimages and simply store integers in the grass objects themselves draw the other squirrels for sobj in squirrelobjs sobj['rect'pygame rect(sobj[' 'camerax sobj[' 'cameray getbounceamount(sobj['bounce']sobj['bouncerate']sobj['bounceheight']) sobj['width'] sobj['height']email questions to the authoral@inventwithpython com