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 7771577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:41:11+00:00 2026-06-01T16:41:11+00:00

I am building a small Space Invaders type game. Or at least trying to.

  • 0

I am building a small Space Invaders type game. Or at least trying to. Most things work, however, I’m having a bad recurring bug. The game works perfectly sometimes. However, about every other time or so, it exits out after I’ve exploded a few enemies and gives the following errors:
Traceback (most recent call last): enemies[count].render() and pygame.error:display Surface quit. The second error seems to pop up always, even when the program seems to funciton fine.

This is my render function:

def render(self):
    screen.blit(self.bitmap, (self.x, self.y))

I can post and/or link to the full code if needed.

  • 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-06-01T16:41:12+00:00Added an answer on June 1, 2026 at 4:41 pm

    From what I can guess, you are probably getting references to surfaces that have already been garbage collected and pygame is quitting when it cannot blit the surface.

    To fix this, go through your code and make sure that you are deleting objects from your ‘enemies’ list when they are removed from the game.

    Another solution would be to use PyGame’s built in Group class. It will track deleted objects for you and you won’t need to worry about problems like this one.

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

Sidebar

Related Questions

Im building a small space shooter game. I have how ever stubbed on a
I am building a small facebook app. Trying to search for values in an
Hi I am building a small simple JS framework for University. I am having
I'm building a small application in ASP.NET MVC. I'm still trying to find my
I'm working on building a chess game in Java, and I'm currently having a
I'm building a small app that gives me the free space available on my
I'm building a small twitter style microblogging service where users can follow other users
I am building a small applet in java. It works fine (really!) when I
I'm building this small java applet in which I need a JPanel which will
I am building a small rails app and I need a way to generate

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.