fix this code and make it work with wasd and mouse movements:import pygame
import random

# Initialize Pygame
pygame.init()

# Screen dimensions
WIDTH, HEIGHT = 600, 400
screen = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("Tower Tumble")

# Colors
WHITE = (255, 255, 255)
BLUE = (0, 0, 255)
RED = (255, 0, 0)
GREEN = (0, 255, 0)

# Game settings
clock = pygame.time.Clock()
floor_height = 40
player_size = 20
gravity = 1
jump_speed = 15

# Player class
class Player:
    def __init__(self):
        self.rect = pygame.Rect(WIDTH//2, HEIGHT - floor_height - player_size, player_size, player_size)
        self.dy = 0
        self.on_floor = True
    
    def jump(self):
        if self.on_floor:
            self.dy = -jump_speed
            self.on_floor = False
    
    def update(self):
        self.dy += gravity
        self.rect.y += self.dy
        
        if self.rect.y >= HEIGHT - floor_height - player_size:
            self.rect.y = HEIGHT - floor_height - player_size
            self.dy = 0
            self.on_floor = True
        
        if self.rect.x < 0:  # Screen boundary
            self.rect.x = 0
        elif self.rect.x > WIDTH - player_size:
            self.rect.x = WIDTH - player_size

# Floor class
class Floor:
    def __init__(self, y):
        self.rect = pygame.Rect(0, y, WIDTH, floor_height)
        self.health = 5  # Each floor can withstand 5 hits
    
    def draw(self, surface):
        pygame.draw.rect(surface, RED, self.rect)
    
    def damage(self):
        self.health -= 1
        if self.health <= 0:
            return True
        return False

# Power-Up class
class PowerUp:
    def __init__(self, x, y, power_type):
        self.rect = pygame.Rect(x, y, player_size, player_size)
        self.power_type = power_type
    
    def apply(self, player):
        if self.power_type == "double_jump":
            player.on_floor = False  # Allow a second jump
        elif self.power_type == "speed_boost":
            player.rect.x += 20  # Temporarily boost player position
        
    def draw(self, surface):
        color = BLUE if self.power_type == "double_jump" else GREEN
        pygame.draw.rect(surface, color, self.rect)

# Create game variables
player = Player()
floors = [Floor(HEIGHT - (i + 1) * floor_height) for i in range(10)]
powerups = []

# Main game loop
running = True
while running:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
            
        if event.type == pygame.KEYDOWN:
            if event.key == pygame.K_SPACE:
                player.jump()
    
    # Update player and floors
    player.update()
    
    # Spawn power-ups
    if random.randint(1, 50) == 1:
        powerups.append(PowerUp(random.randint(0, WIDTH - player_size), 0, random.choice(["double_jump", "speed_boost"])))
    
    for powerup in powerups:
        powerup.rect.y += 5  # Move power-up down
        if powerup.rect.y > HEIGHT:
            powerups.remove(powerup)
        if player.rect.colliderect(powerup.rect):  # If player collects the power-up
            powerup.apply(player)
            powerups.remove(powerup)
    
    for floor in floors:
        floor.draw(screen)
        if player.rect.colliderect(floor.rect):
            continue  # Player is on the floor
        if floor.damage():  # If a floor is destroyed
            floors.remove(floor)
    
    screen.fill(WHITE)
    pygame.draw.rect(screen, BLUE, player.rect)

    for powerup in powerups:
        powerup.draw(screen)
    
    pygame.display.flip()
    clock.tick(30)

pygame.quit()