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

  • Home
  • SEARCH
  • 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 3404154
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:20:52+00:00 2026-05-18T05:20:52+00:00

I need help with a program I’m making. It’s a version of Conway’s Game

  • 0

I need help with a program I’m making. It’s a version of Conway’s Game of Life.
This game is right now made out of 3 files: main.py, cellBoard.py, cell.py

main.py takes care to instance cellboard and make it update its data, give it mouse input, and tell it to draw itself (an instance of the pygame surface is given to it, which handles it to the cells which are the actual ones that draw themselves)

cellboard.py creates a list of cells based off their size and the screen’s size, to fill it properly. It’s a 2D list. When it creates the cells it sets their state (alive currently) and handles them an instance of its instance of the original surface instance.

cell.py contains all the things a cell can do: die, live, be toggled, be drawn.

In fact, when I need to draw the whole board I just call cellBoard’s own draw() and it should take care of calling each cell’s draw. And it does.
The execution gets to the point where the cell should be drawn (checked with prints) and the pixel filling function is executed (using a for loop to cover an area). But nothing is actually drawn to the screen, or at least nothing is visible.

I have no idea what is causing this. I checked the code multiple times, I’ve even rewritten the whole program from scratch to make it more tidy (and I had the same problem as now)

What is causing this? My idea would be that somehow the instance of surface Cell gets is not good anymore to work because something happened to it (it goes through cellboard before getting to each cell, could that be the problem?)

Here’s the source code (all 3 files, they are very short and barebones so they should be easy to read) http://dl.dropbox.com/u/2951174/src.zip

Thanks in advance to anyone who feels like helping. I need to complete this project very fast so your help would be greatly appreciated.

  • 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-18T05:20:52+00:00Added an answer on May 18, 2026 at 5:20 am

    First of a quick suggestion:
    People are much more likely to help you if they don’t have to download a zip file, next time just post the code parts you suspect not to work.

    Anyways, problem seems to be in your main loop:

    #Keyboard events
    events = pygame.event.get()
    for event in events:
        if event.type == pygame.QUIT:
            running = 0
    
    #Mouse events
    #todo
    
    #Grid update  <------- here you update the grid and the cells are being drawn
    cb.draw()
    
    #Graphical output    <------------ here you're filling the WHOLE screen with white
    screen.fill(THECOLORS["white"])    
    
    pygame.display.flip()
    

    You need to move your screen.fill call above cb.draw so you don’t paint over the cells.

    Also in cell.py your drawing code is A) Broken and B) bad.

    Instead of setting every pixel on its own, which is slow and in it’s current state doesn’t draw the cells correctly, you can just as well draw rectangle:

    pygame.draw.rect(self.surface, (100, 10, 10), (self.pos[0], self.pos[1], self.size, self.size))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need help to debug this program . // VirtualFN.cpp : Defines the entry
I need some help with my program. I get this error when I run
I need some help calculating Pi. I am trying to write a python program
I need help on this following aspx code aspx Code: <asp:Label ID =lblName runat
I need help with this route map routes.MapRoute(Blog_Archive, Blog/Archive/{year}/{month}/{day}, new { controller = Blog,
i need help with disk_total_space function.. i have this on my code <?php $sql=select
I need help with my vb.net program. I've added a ribbon bar to the
I need help with setting/changing the value of a label in my C# program
I'm stuck and I need help. Anyway I have Visual Studio 2008 console program
Need help in figuring out a tool which can convert a flash (.swf) chart

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.