if event key in (k_upk_w) movedown false moveup true elif event key in (k_downk_s) moveup false movedown true elif event key in (k_leftk_a) moveright false moveleft true if playerobj['facing'=rightchange player image playerobj['surface'pygame transform scale(l_squir_img(playerobj['size']playerobj['size']) playerobj['facing'left elif event key in (k_rightk_d) moveleft false moveright true if playerobj['facing'=leftchange player image playerobj['surface'pygame transform scale(r_squir_img(playerobj['size']playerobj['size']) playerobj['facing'right elif winmode and event key =k_r return elif event type =keyup stop moving the player' squirrel if event key in (k_leftk_a) moveleft false elif event key in (k_rightk_d) moveright false elif event key in (k_upk_w) moveup false elif event key in (k_downk_s) movedown false elif event key =k_escape terminate( if not gameovermode actually move the player if moveleft playerobj[' '-moverate if moveright playerobj[' '+moverate if moveup playerobj[' '-moverate if movedown