Jake Huston
Jake Huston

Reputation: 71

Opening a new window in PyGame?

I just started developing a PyGame. Using Python (Captain Obvious Strikes Again)

And I got my main menu all set.

It displays a text saying: Hit space when you're ready. So basicly, I want make an event that triggers and opens a new window when the user presses the spacebar key. Closing the previous window. I know there is a way of doing this, but how?

Upvotes: 2

Views: 1850

Answers (1)

Pip
Pip

Reputation: 4457

To clear your window, do something like this:

Pseudocode:
def startGame:
    if buttonPressed = True:
        screen.fil(256, 256, 256)
    else:
        screen.blit(buttonImage, (x, y)

after that, draw the game or whatever itself.

Upvotes: 1

Related Questions