this is my code 
# Install pgzero (Settings - Project - Interpreter)
import pgzrun
import random
from pgzhelper import *

# Game screen dimension
TITLE = 'T-rex Runner'
WIDTH = 800
HEIGHT = 600

music.play('music')

# Colours
black = (0, 0, 0)
brown = (71, 34, 18)
red = (212, 47, 47) #de game over sign
white = (255, 255, 255) #score at the end
green = (79, 240, 117)
blue = (105, 226, 240)

# Moon
moon = Actor('moon')
moon.x = WIDTH - 100
moon.y = 80

# Haunted houses
house1 = Actor('house2')
house1.x = WIDTH / 28
house1.y = HEIGHT / 1.25

# Haunted houses
house2 = Actor('house2')
house2.x = WIDTH / 15
house2.y = HEIGHT / 1.25

# Haunted houses
house3 = Actor('house2')
house3.x = WIDTH / 10
house3.y = HEIGHT / 1.25

# Haunted houses
house4 = Actor('house2')
house4.x = WIDTH / 7.5
house4.y = HEIGHT / 1.25

# Haunted houses
house5 = Actor('house2')
house5.x = WIDTH / 6
house5.y = HEIGHT / 1.25

# Haunted houses
house6 = Actor('house2')
house6.x = WIDTH / 5
house6.y = HEIGHT / 1.25

# Haunted houses
house7 = Actor('house2')
house7.x = WIDTH / 4.25
house7.y = HEIGHT / 1.25

# Haunted houses
house8 = Actor('house2')
house8.x = WIDTH / 3.75
house8.y = HEIGHT / 1.25

# Haunted houses
house9 = Actor('house2')
house9.x = WIDTH / 3.34
house9.y = HEIGHT / 1.25

# Haunted houses
house10 = Actor('house2')
house10.x = WIDTH / 3
house10.y = HEIGHT / 1.25

# Haunted houses
house11 = Actor('house2')
house11.x = WIDTH / 2.72
house11.y = HEIGHT / 1.25

# Haunted houses
house12 = Actor('house2')
house12.x = WIDTH / 2.7
house12.y = HEIGHT / 1.25

# Haunted houses
house13 = Actor('house2')
house13.x = WIDTH / 2.46
house13.y = HEIGHT / 1.25

# Haunted houses
house14 = Actor('house2')
house14.x = WIDTH / 2.25
house14.y = HEIGHT / 1.25

# Haunted houses
house15 = Actor('house2')
house15.x = WIDTH / 2.08
house15.y = HEIGHT / 1.25

# Haunted houses
house16 = Actor('house2')
house16.x = WIDTH / 1.95
house16.y = HEIGHT / 1.25

# Haunted houses
house17 = Actor('house2')
house17.x = WIDTH / 1.83
house17.y = HEIGHT / 1.25

# Haunted houses
house18 = Actor('house2')
house18.x = WIDTH / 1.72
house18.y = HEIGHT / 1.25

# Haunted houses
house19 = Actor('house2')
house19.x = WIDTH / 1.63
house19.y = HEIGHT / 1.25

# Haunted houses
house20 = Actor('house2')
house20.x = WIDTH / 1.55
house20.y = HEIGHT / 1.25

# Haunted houses
house21 = Actor('house2')
house21.x = WIDTH / 1.47
house21.y = HEIGHT / 1.25

# Haunted houses
house22 = Actor('house2')
house22.x = WIDTH / 1.4
house22.y = HEIGHT / 1.25

# Haunted houses
house23 = Actor('house2')
house23.x = WIDTH / 1.34
house23.y = HEIGHT / 1.25

# Haunted houses
house24 = Actor('house2')
house24.x = WIDTH / 1.28
house24.y = HEIGHT / 1.25

# Haunted houses
house25 = Actor('house2')
house25.x = WIDTH / 1.225
house25.y = HEIGHT / 1.25

# Haunted houses
house26 = Actor('house2')
house26.x = WIDTH / 1.17
house26.y = HEIGHT / 1.25

# Haunted houses
house27 = Actor('house2')
house27.x = WIDTH / 1.125
house27.y = HEIGHT / 1.25

# Haunted houses
house28 = Actor('house2')
house28.x = WIDTH / 1.08
house28.y = HEIGHT / 1.25

# Haunted houses
house29 = Actor('house2')
house29.x = WIDTH / 1.04
house29.y = HEIGHT / 1.25

# Haunted houses
house30 = Actor('house2')
house30.x = WIDTH / 1
house30.y = HEIGHT / 1.25

# Haunted houses
house31 = Actor('house2')
house31.x = WIDTH / 200
house31.y = HEIGHT / 1.25

# Haunted houses
house32 = Actor('house1')
house32.x = WIDTH / 1.28
house32.y = HEIGHT / 1.25

# Haunted houses
house33 = Actor('house1')
house33.x = WIDTH / 2
house33.y = HEIGHT / 1.25

# Haunted houses
house34 = Actor('house3')
house34.x = WIDTH / 1.84
house34.y = HEIGHT / 1.23

# Haunted houses
house35 = Actor('house4')
house35.x = WIDTH / 50
house35.y = HEIGHT / 6
house35.scale = 2

# Haunted houses
house36 = Actor('house4')
house36.x = WIDTH / 2
house36.y = HEIGHT / 5
house36.scale = 2

# Haunted houses
house37 = Actor('house4')
house37.x = WIDTH / 5
house37.y = HEIGHT / 4
house37.scale = 2

# Haunted houses
house38 = Actor('house4')
house38.x = WIDTH / 1.2
house38.y = HEIGHT / 4.5
house38.scale = 2

# Bat
bat = Actor('bat1')
bat.scale = 0.5
bat.x = 900
bat.y = 100
bat.images = ['bat1', 'bat2', 'bat3', 'bat4']
bat.fps = 10

# Zombie
zombie = Actor('walk1')
zombie.x = 100
zombie.y = 470
zombie.images = []
for i in range(1, 11):
    zombie.images.append(f"walk{i}")
zombie.fps = 10

velocity = 0 # How fast our zombie moves in the up/down direction
gravity = 1 # Gravity will change our velocity. The bigger, the more pull towards the ground

# Gost
ghost = Actor('ghost')
ghost.x = random.randint(900, 5000)
ghost.y = random.randint(250, 350)
ghost.scale = 1

# Obstacles
obstacles = [] # Empty list that will hold the spike obtacles
obstacles_timeout = 0 # This number is a counter to ensure sikes appear in our game - but not all at once

# Game variables
score = 0
game_over = False
deathsound = False
paused = False


def update():
    global velocity # Makes a global variable of velocity
    global score
    global obstacles_timeout
    global game_over
    global deathsound
    global paused

    if keyboard.r:
        game_over = False
        score = 0

    if not paused:
        #### ZOMBIE ####
        # zombie.next_image() is also possible, this way you don't heed the animate() and the fps property
        zombie.animate()

        # Jump in the air when the up arrow is pressed
        if keyboard.up and zombie.y == 470:
            velocity = -18
        zombie.y = zombie.y + velocity
        velocity += gravity

        # Stop zombie falling of the screen
        if zombie.y > 470:
            velocity = 0
            zombie.y = 470

        #### BAT ####
        bat.animate()
        bat.x -= 3
        if bat.x < -50:
            bat.x = random.randint(1000,15000)
            bat.y = random.randint(100, 250)

        #### GHOST ####
        if not game_over:
            ghost.x -= 5
            if ghost.x < -50:
                ghost.x = random.randint(900, 5000)
                ghost.y = random.randint(250, 350)

        # Zombie & Ghost collision
        if zombie.colliderect(ghost):
            sounds.collect.play()
            ghost.x = random.randint(900, 5000)
            ghost.y = random.randint(250, 350)
            score += 5

        #### SPIKES ####
        if not game_over:
            obstacles_timeout += 1 # On each frame refresh we add 1 to the counter
            if obstacles_timeout > random.randint(60, 7000):
                spikes = Actor('spikes')
                spikes.x = 860
                spikes.y = 500
                spikes.scale = 1
                obstacles.append(spikes) # Add spikes to list
                obstacles_timeout = 0

            # Move spikes across the screen
            for spikes in obstacles:
                spikes.x -= 8
                
                if spikes.x < -50:
                    obstacles.remove(spikes)
                    score += 1

            # Collision between zombie and spikes
            if zombie.collidelist(obstacles) != -1: # -1 is no collision
                game_over = True
                obstacles.remove(spikes)

                if not deathsound:
                    sounds.gameover.play()
                deathsound = True

    if keyboard.space:  # Toggle the paused state when the space bar is pressed
        paused = not paused

# Function to save the score in the appropriate place
def save_score(score):
    try:
        with open('scores.txt', 'r') as file:
            scores = [int(line.strip()) for line in file.readlines()]
            sorted_scores = sorted(scores, reverse=True)

        # Find the appropriate place for the new score
        if not sorted_scores or score > sorted_scores[0]:  # If the list is empty or the new score is higher than the first place
            sorted_scores = [score] + sorted_scores[:2]
        elif not sorted_scores[1] or score > sorted_scores[1]:  # If the second place is empty or the new score is higher than the second place
            sorted_scores = [sorted_scores[0], score] + sorted_scores[2:]
        elif not sorted_scores[2] or score > sorted_scores[2]:  # If the third place is empty or the new score is higher than the third place
            sorted_scores = sorted_scores[:2] + [score]
        elif not sorted_scores[1] or score > sorted_scores[1]:  # If the new score is lower than the first but higher than the second
            sorted_scores = [sorted_scores[0], score, sorted_scores[1]]

        with open('scores.txt', 'w') as file:
            for s in sorted_scores:
                file.write(str(s) + '\n')

    except FileNotFoundError:
        with open('scores.txt', 'w') as file:
            file.write(str(score) + '\n')

# Function to load the top three scores excluding the first place
def load_top_scores():
    try:
        with open('scores.txt', 'r') as file:
            scores = [int(line.strip()) for line in file.readlines()]
            sorted_scores = sorted(scores, reverse=True)
            top_scores = sorted_scores[:1] + sorted_scores[1:3]  # Exclude the first place when loading
            return top_scores
        
    except FileNotFoundError:
        # Return an empty list if the file doesn't exist
        return []

# Function to display top scores
def display_top_scores(top_scores):
    for i, score in enumerate(top_scores):
        screen.draw.text(f"Top {i+1}: {score}", centerx=380, centery=350 + i*50, color=(white), fontname='creepster', fontsize=30)

def draw():
    screen.draw.filled_rect(Rect(0, 0, WIDTH, HEIGHT - 100), (blue))  # Sky
    screen.draw.filled_rect(Rect(0, 500, WIDTH, HEIGHT), (green))  # Ground

    if paused:
        screen.draw.text('Paused', centerx=WIDTH // 2, centery=HEIGHT // 2, color=(white), fontname='creepster', fontsize=80)
        screen.draw.text('Press SPACE to resume', centerx=WIDTH // 2, centery=HEIGHT // 2 + 50, color=(white), fontname='creepster', fontsize=30)

    if game_over:
        screen.draw.text('Game Over', centerx=380, centery=150, color=(red), fontname='creepster', fontsize=80)
        screen.draw.text(f"Score: {score}", centerx=380, centery=300, color=(white), fontname='creepster', fontsize=60)
        screen.draw.text(f"Press r to restart", centerx=380, centery=230, color=(white), fontname='creepster', fontsize=60)
        top_scores = load_top_scores()
        display_top_scores(top_scores)
        save_score(score)  # Save the current score
        music.stop()

    else:
        screen.draw.text(f"Score: {score}", (20, 20), color=(red), fontname='creepster', fontsize=30)
        moon.draw()
        house1.draw()
        house2.draw()
        house3.draw()
        house4.draw()
        house5.draw()
        house6.draw()
        house7.draw()
        house8.draw()
        house9.draw()
        house10.draw()
        house11.draw()
        house12.draw()
        house13.draw()
        house14.draw()
        # house15.draw()
        # house16.draw()
        # house17.draw()
        house18.draw()
        house19.draw()
        house20.draw()
        house21.draw()
        house22.draw()
        house23.draw()
        house24.draw()
        house25.draw()
        house26.draw()
        house27.draw()
        house28.draw()
        house29.draw()
        house30.draw()
        house31.draw()
        house32.draw()
        house33.draw()
        house34.draw()
        house35.draw()
        house36.draw()
        house37.draw()
        house38.draw()
        bat.draw()
        zombie.draw()
        ghost.draw()

        for spikes in obstacles:
            spikes.draw()

# Run the game
pgzrun.go()

Can you make it so i can operate the jump with making a thumbs up infront of my webcam, a flat hand to pause, and a fist to restart