0

Alright so I wrote a little program using Python 2.7 and the pygame module. For some reason, no matter what I do, the actual Pygame screen itself won't flip() or update() at all, no matter what I do. The code's pictured below(it's rather long):

import pygame
pygame.init()
DISPLAY = pygame.display.set_mode((800, 600))
pygame.display.set_caption('Super Secret Game Name')
clock = pygame.time.Clock()
fps = 30

arrowimg = pygame.image.load('arrowlogo.png')

WHITE = (0, 0, 0)
BLACK = (255, 255, 255)
def arrowimg(x1, y1):
    DISPLAY.blit(arrowimg,(x1, y1))

x1 = 100
y1 = 100

active = False

while not active:

    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            active = True

    DISPLAY.fill(WHITE)
    pygame.display.flip()

It will open up a pygame window, but it will be completely black and nothing will happen, no matter what I do. Any idea's how to help?

2
Contributors
1
Reply
11
Views
1 Year
Discussion Span
Last Post by Gribouillis
0

Your code is almost the same as code in this tutorialClick Here. There are missing calls to arrowimg() and pygame.display.update() at the end of your code. Also it is an error to use the same name arrowimg for the image and your function. Use 2 different names.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.