Open JeremiahCheatham opened 2 years ago
Here is how my pygame zero is installed.
sudo pip install git+https://github.com/lordmauve/pgzero.git --no-deps --upgrade
sudo pip install pyfxr
Moving to pygame zero 1.2.1 did fix the image loading mostly. But it brings other issues. The ICON variable now needs the full file path name with extension. This isn't needed in dev branch.
from pgzero.builtins import screen
Code can't be used. This means both pyflakes and flake8 will complain about error in the code because screen is undefined. I still have to do this with all other builtins. Is there an actual fix for this issue?
And as has been since i first started using pygame zero with my son. Without adding
def update():
pass
into the code, all early project for pygame zero in all out books will fail since the actual screen is created after the image is drawn. Without the refresh of the update function you never see it. This is a major issue that almost caused us to give up entirely. But it means that all those books either have typos or there is a bug in the program.
Without adding
def update(): pass
into the code
Please can you open a separate issue for this containing a full example program; I don't understand what you are trying to do and what you expect to happen.
Again someone has changed my title to remove needed information. The new title does not fit the bug i have listed above.
IDE Mode as listed here https://pygame-zero.readthedocs.io/en/stable/ide-mode.html
import pgzrun
pgzrun.go()
The above bug is present whether import pygame is present or not. It has nothing to do with this. It has to do with changes made else were. I had looked it up in your changes at one point but it was over my head so i just listed it here. But editing peoples bug reports is well hmmm......
to reproduce the crash , just run the following demo.py from an IDE you will then get the error : pygame.error: No video mode has been set
import pgzrun
WIDTH = 800
HEIGHT = 600
def draw():
screen.clear()
screen.draw.circle((400, 300), 30, 'white')
pgzrun.go()
the problem come from the removing of the following lines in runner.py in function prepare_mod
see https://github.com/lordmauve/pgzero/commit/bf48fc964b5168d8e1e101a32adc2ac6cb685c69
PGZeroGame.show_default_icon()
pygame.display.set_mode((100, 100), DISPLAY_FLAGS)
if you add them back it doens't crash anymore
to temporary fix it, just add in your project pygame.display.set_mode((100, 100), DISPLAY_FLAGS) after all imports just before any object creation
same here
I had to reinstall my system last night so ended up reinstalling pygame zero again. I'm on Arch Linux. With all the incompatibilities with python and pygame and old code i am running the dev branch of pygame zero. with the standard archlinux SDL, pygame, and python packages. pygame zero is the only one i have to manually install. Also i have to disable it's dependencies or it tries to pull uncompatable pygame packages in to my system. This has been a headache since we first started using pygame zero. Not sure if it's a major python problem or who is at fault. However it has been working for me as long as i use all standard packages and pip the dev version of pygame zero without letting it install pygame. But today it's broken after fresh install. I found that setting the ICON variable or creating an Actor causes a crash. However blitting an image like a background in the draw function doesn't.
or loading an Actor.
The above code will cause the crash.
The equivalent pygame code seems to work just fine.
This issue just started today but i haven't update pygame zero in maybe month or more. The rest of the system is updated daily.