when the left arrow key is pressed down (and moving to the left is valid move for the falling pieceas determined by the call to isvalidposition())then we should change the position to one space to the left by subtracting the value of fallingpiece[' 'by the isvalidposition(function has optional parameters called adjx and adjy normally the isvalidposition(function checks the position of the data provided by the piece object that is passed for the second parameter howeversometimes we don' want to check where the piece is currently locatedbut rather few spaces over from that position if we pass - for the adjx ( short name for --adjusted ||)then it doesn' check the validity of the position in the piece' data structurebut rather if the position of where the piece would be if it was one space to the left passing for adjx would check one space to the right there is also an adjy optional parameter passing - for adjy checks one space above where the piece is currently positionedand passing value like for adjy would check three spaces down from where the piece is the movingleft variable is set to trueand just to make sure the falling piece won' move both left and rightthe movingright variable is set to false on line the lastmovesidewaystime variable will be updated to the current time on line these variables are set so that the player can just hold down the arrow key to keep moving the piece over if the movingleft variable is set to truethe program can know that the left arrow key (or keyhas been pressed and not yet let go and if seconds (the number stored in movesidewaysfreqhas passed since the time stored in lastmovesidewaystimethen it is time for the program to move the falling piece to the left again the lastmovesidewaystime works just like how the lastclicktime variable did in the simulate elif (event key =k_right or event key =k_dand isvalidposition(boardfallingpieceadjx= ) fallingpiece[' '+ movingright true movingleft false lastmovesidewaystime time time(the code on lines to is almost identical to lines to except that it handles moving the falling piece to the right when the right arrow key (or keyhas been pressed rotating the block (if there is room to rotateelif (event key =k_up or event key =k_w)email questions to the authoral@inventwithpython com