Play in App
Sign up
Play in App
iOS
Android
Sign up
qhimcelisAdmin
Follow
3.7k
37
8 Comments
Next up
ghdhdbx
1d
I rect
1
Reply
Dyllenati0nnnn
11h
But on tablet.. use use your fingers
Reply
Dyllenati0nnnn
11h
import pygame # Initialize Pygame pygame.init() screen = pygame.display.set_mode((500, 500)) clock = pygame.time.Clock() player_pos = [250, 250] speed = 5 running = True while running: for event in pygame.event.get(): if event.type == pygame.QUIT: running = False # Get the state of all keyboard buttons keys = pygame.key.get_pressed() # Movement logic if keys[pygame.K_w]: player_pos[1] -= speed # Up if keys[pygame.K_s]: player_pos[1] += speed # Down if keys[pygame.K_a]: player_pos[0] -= speed # Left if keys[pygame.K_d]: player_pos[0] += speed # Right # Drawing screen.fill((0, 0, 0)) # Clear screen pygame.draw.circle(screen, (0, 255, 0), player_pos, 20) # Draw player pygame.display.flip() clock.tick(60) # Limit to 60 FPS pygame.quit()
Reply
Dyllenati0nnnn
11h
import pygame # Initialize Pygame pygame.init() screen = pygame.display.set_mode((500, 500)) clock = pygame.time.Clock() player_pos = [250, 250] speed = 5 running = True while running: for event in pygame.event.get(): if event.type == pygame.QUIT: running = False # Get the state of all keyboard buttons keys = pygame.key.get_pressed() # Movement logic if keys[pygame.K_w]: player_pos[1] -= speed # Up if keys[pygame.K_s]: player_pos[1] += speed # Down if keys[pygame.K_a]: player_pos[0] -= speed # Left if keys[pygame.K_d]: player_pos[0] += speed # Right # Drawing screen.fill((0, 0, 0)) # Clear screen pygame.draw.circle(screen, (0, 255, 0), player_pos, 20) # Draw player pygame.display.flip() clock.tick(60) # Limit to 60 FPS pygame.quit()
Reply
Dyllenati0nnnn
13h
You know you can use wasd in Python, right?
Reply
EldenTV_Castle
1d
Hello
Reply
Comment in the App