if invulnerablemode and time time(invulnerablestarttime invulntime invulnerablemode false move all the squirrels for sobj in squirrelobjs move the squirreland adjust for their bounce sobj[' '+sobj['movex' sobj[' '+sobj['movey' sobj['bounce'+ if sobj['bounce'sobj['bouncerate'] sobj['bounce' reset bounce amount random chance they change direction if random randint( dirchangefreq sobj['movex'getrandomvelocity( sobj['movey'getrandomvelocity( if sobj['movex' faces right sobj['surface'pygame transform scale(r_squir_img(sobj['width']sobj['height']) elsefaces left sobj['surface'pygame transform scale(l_squir_img(sobj['width']sobj['height']) go through all the objects and see if any need to be deleted for in range(len(grassobjs - - ) if isoutsideactivearea(cameraxcameraygrassobjs[ ]) del grassobjs[ for in range(len(squirrelobjs - - ) if isoutsideactivearea(cameraxcameraysquirrelobjs[ ]) del squirrelobjs[ add more grass squirrels if we don' have enough while len(grassobjsnumgrass grassobjs append(makenewgrass(cameraxcameray) while len(squirrelobjsnumsquirrels squirrelobjs append(makenewsquirrel(cameraxcameray) adjust camerax and cameray if beyond the "camera slack playercenterx playerobj[' 'int(playerobj['size' playercentery playerobj[' 'int(playerobj['size' if (camerax half_winwidthplayercenterx cameraslack camerax playercenterx cameraslack half_winwidth elif playercenterx (camerax half_winwidthcameraslack camerax playercenterx cameraslack half_winwidth