random randint(camerax winwidthcamerax ( winwidth) random randint(cameray winheightcameray ( winheight) create rect object with the random coordinates and use colliderect( to make sure the right edge isn' in the camera view objrect pygame rect(xyobjwidthobjheight if not objrect colliderect(camerarect) return xy def makenewsquirrel(cameraxcameray) sq { generalsize random randint( multiplier random randint( sq['width'(generalsize random randint( )multiplier sq['height'(generalsize random randint( )multiplier sq[' ']sq[' 'getrandomoffcamerapos(cameraxcameraysq['width']sq['height'] sq['movex'getrandomvelocity( sq['movey'getrandomvelocity( if sq['movex' squirrel is facing left sq['surface'pygame transform scale(l_squir_img(sq['width']sq['height']) elsesquirrel is facing right sq['surface'pygame transform scale(r_squir_img(sq['width']sq['height']) sq['bounce' sq['bouncerate'random randint( sq['bounceheight'random randint( return sq def makenewgrass(cameraxcameray) gr { gr['grassimage'random randint( len(grassimages gr['width'grassimages[ get_width( gr['height'grassimages[ get_height( gr[' ']gr[' 'getrandomoffcamerapos(cameraxcameraygr['width']gr['height'] gr['rect'pygame rect(gr[' ']gr[' ']gr['width']gr['height'] return gr def isoutsideactivearea(cameraxcamerayobj) return false if camerax and cameray are more than email questions to the authoral@inventwithpython com