move left or up the larger the valuethe farther they move on each iteration through the game loop (which means they move fasterthe for loop on line will apply this moving code to each of the enemy squirrel objects in the squirrelobjs list firstline and will adjust their 'xand 'ykeysvalues sobj['bounce'+ if sobj['bounce'sobj['bouncerate']sobj['bounce' reset bounce amount the value in sobj['bounce'is incremented on each iteration of the game loop for each squirrel when this value is the squirrel is at the very beginning of its bounce when this value is equal to the value in sobj['bouncerate'the value is at its end (this is why smaller sobj['bouncerate'value makes for faster bounce if sobj['bouncerate'is then it only takes three iterations through the game loop for the squirrel to do full bounce if sobj['bouncerate'were then it would take ten iterations when sobj['bounce'gets larger than sobj['bouncerate']then it needs to be reset to this is what lines and do 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'])there is chance on each iteration through the game loop that the squirrel will randomly change speed and direction on line the random randint( call randomly selects an integer out of possible integers if this number is less than dirchangefreq (which we set to on line then new value will be set for sobj['movex'and sobj['movey'because this means the squirrel might have changed directionthe surface object in sobj['surface'should be replaced by new one that is properly facing left or right and scaled to the squirrel' size this is what lines to determine note that line gets surface object scaled from r_squir_img and line gets one scaled from l_squir_img email questions to the authoral@inventwithpython com