Can someone add this to replit please and make it a game

Hey @Octopi_DOOMSLAYER, here's a simple third person shooter game code in Python using Pygame:

import pygame
pygame.init()

# set the screen dimensions
screen_width = 800
screen_height = 600
screen = pygame.display.set_mode((screen_width, screen_height))
pygame.display.set_caption("Third Person Shooter")

# set the player dimensions and starting position
player_width = 64
player_height = 128
player_x = screen_width/2 - player_width/2
player_y = screen_height/2 - player_height/2

# set the enemy dimensions and starting position
enemy_width = 64
enemy_height = 64
enemy_x = screen_width/4 - enemy_width/2
enemy_y = screen_height/4 - enemy_height/2

# set the player and enemy color
player_color = (255, 255, 0)
enemy_color = (255, 0, 0)

# set the game loop
running = True
while running:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False

    # get the player and enemy positions
    player_pos = pygame.mouse.get_pos()
    player_x = player_pos[0]
    player_y = player_pos[1]
    enemy_pos = (enemy_x, enemy_y)

    # draw the player and enemy
    screen.fill((0, 0, 0))
    pygame.draw.rect(screen, player_color, (player_x, player_y, player_width, player_height))
    pygame.draw.rect(screen, enemy_color, (enemy_x, enemy_y, enemy_width, enemy_height))

    # update the screen
    pygame.display.update()

# quit pygame
pygame.quit()

This code sets up the basic game layout with a player and an enemy. The player's position is controlled by the user's mouse movements. You can add more features such as shooting and health bar by extending the code. Have fun coding your third person shooter game!

I don’t think this code works ;/

I could try running it but I’m not sure if it works.

1 Like

This may work I don’t do much with python pretty much none but I’ll run it though replit

1 Like

It would work he did say base but it is missing some variables but it would give you a nice start

1 Like

Even if the code works, people probably have already done it before.