tcreeds / PyCut

PyCut, a pizza-making puzzle game made for RIT IGME-582's final project
https://wiki.sugarlabs.org/go/Activities/PyCut
Mozilla Public License 2.0
0 stars 0 forks source link

Black Screen #4

Open adf5051 opened 7 years ago

adf5051 commented 7 years ago

Original Issue

To close issue #1 we removed enum. This allows us to run the raw python file but the final XO program presents us with a black screen. The original issue states that using enum34 fixes this issue. Maybe we should try this as well.

tcreeds commented 7 years ago

pygame.display.get_surface() returns None when running PyCut as an activity. It works fine when directly invoked with python, but the packaged version apparently cannot access the screen context.

jwflory commented 7 years ago

This might be something @wilfriedE could advise a little better on. We had the same issue when building the game originally, but I'm still a little unclear on what our fix was.

adf5051 commented 7 years ago

I was able to get the original repo's version to run with python by installing the enum34 module. But I still get the black screen when I build the xo file.

tcreeds commented 7 years ago

Stack trace for black screen error

Traceback (most recent call last) : File "/home/olpc/Activities/PyCut.activity/sugargame/init.py", line 58, in _run_pygame_cb main.fn() File "/home/olpc/Activities/PyCut.activity/game/init.py", line 95, in run self.game.loop() File "/home/olpc/Activities/PyCut.activity/game/init.py", line 87, in game_loop self.active_scene.Render() File "/home/olpc/Activities/PyCut.activity/game/scenes/title_scene.py", line 36, in Render self.screen.fill((255, 255, 255)) AttributeError: 'NoneType' object has no attribute 'fill'

So self.screen is None, and self.screen is set with pygame.display.get_surface()

adf5051 commented 7 years ago

I'm getting assertion errors about pygame being init'ed before run_pygame. moving some stuff around I get other assertion errors because run_pygame getting called too many times...but that seems more to be that the surface is being set too many times. Look more into this later...

wilfriedE commented 7 years ago

@adf5051 Can you post the full log for the error?

tcreeds commented 7 years ago

I posted the trace earlier in this thread, the screen drawing surface is None

wilfriedE commented 7 years ago

@tcreeds, @adf5051 The Black Screen Issue is resolved in https://github.com/tcreeds/PyCut/pull/14