Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. JavaScript
  4. Pygame image wont show up until I close the window

Pygame image wont show up until I close the window

Scheduled Pinned Locked Moved JavaScript
game-devannouncement
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    c0d3r1 2
    wrote on last edited by
    #1

    I am creating a game with pygame and an image won't show up until the window is loading to be closed. This is my code so far: ``` import pygame pygame.init() screen = pygame.display.set_mode((800, 600)) pygame.display.set_caption("ALix") icon = pygame.image.load("nater.jpg") pygame.display.set_icon(icon) playerImg = pygame.image.load('nater.jpg') playerX = 400 playerY = 300 def player(): screen.blit(playerImg, (playerX, playerY)) running = True while running: screen.fill((255, 255, 255)) for event in pygame.event.get(): if event.type == pygame.QUIT: running = False player() pygame.display.update() ```

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups