import pygame from pygame.locals import * import sys import random username = input("What is your username? ") kill = 2 pygame.init() display = pygame.display.set_mode((950, 700)) FPS_CLOCK = pygame.time.Clock() class Player: def __init__(self): self.rect = pygame.draw.rect(display, (255, 0, 0), (50, 50, 50, 50)) player = Player() flag = 1 while 1: for event in pygame.event.get(): if event.type == pygame.KEYDOWN: if event.key == pygame.K_1: pygame.mouse.set_cursor(pygame.SYSTEM_CURSOR_ARROW) if event.key == pygame.K_2: pygame.mouse.set_cursor(pygame.SYSTEM_CURSOR_HAND) if event.key == pygame.K_3: pygame.mouse.set_cursor(pygame.SYSTEM_CURSOR_WAIT) if event.key == pygame.K_F5: print(f"{username} Emote 1") if event.key == pygame.K_w: print(f"{username} moved foward") if event.key == pygame.K_s: print(f"{username} moved backwards") if event.key == pygame.K_a: print(f"{username} to the left") if event.key == pygame.K_d: print(f"{username} to the right") if event.key == pygame.K_SPACE: print(f"{username} Jumped") if event.key == pygame.K_F1: print(f"{username} built a wall!") if event.key == pygame.K_F2: print(f"{username} built a ramp!") if event.key == pygame.K_F3: print(f"{username} built a cone!") if event.key == pygame.K_F4: print(f"{username} built a floor!") if event.key == pygame.K_h: print(f"{username} healed!") if event.key == pygame.K_e: print(f"{username} opened a chest!") if event.key == pygame.K_1: print(f"{username} used a zipline! ") if event.type == pygame.QUIT: pygame.quit() sys.exit() if event.type == pygame.MOUSEBUTTONDOWN: mouse_presses = pygame.mouse.get_pressed() if mouse_presses[0]: kill = random.randint(1, 3) if kill == 1: print(f"{username} shoots at nothing!") elif kill == 2: print(f"{username} shoots and hits a player!") else: print(f"{username} shoots and kills a player!") if mouse_presses[1]: print(f"{username} switches through weapons") if mouse_presses[2]: print(f"{username} zoomed in using the sniper scope") if player.rect.collidepoint(pygame.mouse.get_pos()): print(f"{username} used a rocket launcher!") if event.type == pygame.MOUSEBUTTONUP: if player.rect.collidepoint(pygame.mouse.get_pos()): print("██╗ ██╗ █████╗ ██████╗ ██████╗ ██████╗ ███╗ ███╗") print("██║ ██╔╝██╔══██╗██╔══██╗██╔═══██╗██╔═══██╗████╗ ████║") print("█████╔╝ ███████║██████╔╝██║ ██║██║ ██║██╔████╔██║") print("██╔═██╗ ██╔══██║██╔══██╗██║ ██║██║ ██║██║╚██╔╝██║") print("██║ ██╗██║ ██║██████╔╝╚██████╔╝╚██████╔╝██║ ╚═╝ ██║") print("╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝") print(pygame.mouse.get_rel()) pygame.display.update() FPS_CLOCK.tick(5)