# move the block if event.key == pygame.K_RIGHT: activeBlock.move("right") key = "right" elif event.key == pygame.K_LEFT: activeBlock.move("left") key = "left" elif event.key == pygame.K_DOWN: activeBlock.move("down") key = "down" elif event.key == pygame.K_UP: activeBlock.rotate() activeBlock.move() # check if we need to create a new block if screen.detectingCollision(activeBlock) == "Bottom reached": screen.addBlock(activeBlock) activeBlock.createNew() # check if we need to create a new block elif screen.detectingCollision(activeBlock) == "Set back": activeBlock.setBack(key) if key == "down": screen.addBlock(activeBlock) activeBlock.createNew() activeBlock.draw() screen.drawBottom() pygame.display.update()