#๐Ÿ”’ pygame getting image help

8 messages ยท Page 1 of 1 (latest)

magic gullBOT
#

@glossy rune

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

glossy rune
#
import pygame

# pygame setup
pygame.init()
w,h = 1280, 720
screen = pygame.display.set_mode((w, h))
clock = pygame.time.Clock()
pygame.display.set_caption("Space Shooter")
pygame.display.get_caption(images/player.png)

surf = pygame.Surface((50,50))
surf.fill("red")
player_surf = pygame.image.load(images/player.png)

run = True

while run:




    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            run = False



    # fill the screen with a color to wipe away anything from last frame
    screen.fill("darkgrey")
    screen.blit(surf, (640, 310))
    # RENDER YOUR GAME HERE
    pygame.display.update()

    clock.tick(60)  # limits FPS to 60

pygame.quit()```
last yarrow
#

the directory is supposed to be a string

glossy rune
#

oh thank you

last yarrow
#

np

glossy rune
#

fixed everything lol

magic gullBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.