Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7070407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:33:46+00:00 2026-05-28T05:33:46+00:00

Basically, my main idea is that we would program most of the entire game

  • 0

Basically, my main idea is that we would program most of the entire game in a while loop (except when constructing a screen). When the game ends, I let the user enter another while loop so that the player is getting the chance to click the mouse (which starts the game over) while in the loop. The loop I coded is below. However, the screen keeps freezing (i.e. the mouse press method never works) without any errors. I don’t know why it’s happening.

while not pygame.mouse.get_pressed()[0]:
clock.tick(20)
background_image = pygame.image.load("GameOver.jpg").convert()

When the mouse is pressed, the while loop guiding the rest of the game goes over once again. Please ask if you’re confused about anything about my problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:33:47+00:00Added an answer on May 28, 2026 at 5:33 am

    You need to be sure you’re calling pygame.event.get() to get the events from the cue before checking for pygame.mouse.get_pressed() or it will not work.

    It’s a bit difficult to suggest where to put into your code without seeing what’s around it but basically:

    pygame.event.get()
    while not pygame.mouse.get_pressed()[0]:
        #DO SOMETHING
        pygame.event.get()
    

    You may find it is easier to just set a flag when they enter this mode and check on the flag instead of creating another while loop.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, I have a UIImageView that will loop through 8 PNGs over 0.5 seconds.
I always had the idea to make a textarea based program, that gets the
I have a weird problem with aRuby program I'm writing. Basically the idea is
Basically, I have somewhere in my main code where this line of code is
I have a main class(which is basically a netbeans form;drag and drop) from where
The title pretty much says it all, but basically I have a main parent
Basically I've made a form in Cakephp 2.1 with a jQuery button that appends
I am trying to do the design of a Bejeweled game. I have basically
Possible Duplicate: .eof() loop not working So I have a fairly simple C++ program
I've been wanting to write a music program for a while, but I don't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.