Questions tagged [pgzero]

pgzero (Pygame Zero) is a Python library providing a zero-boilerplate game development framework. It is based on another third-party library named pygame.

pgzero (Pygame Zero) is a Python library providing a zero-boilerplate game development framework. It is based on the library pygame.

PyPi: https://pypi.org/project/pgzero
Source code: https://github.com/lordmauve/pgzero
Documentation: https://pygame-zero.readthedocs.io

104 questions
0
votes
1 answer

Unable to find vcvarsall.bat (Unsolved for 2022 version, Python)

I've been trying to instsall pgzero library for python, but however it keeps giving me an error: "unable to find vcvarsall.bat " I have been searching over StackOverflow, it shows up how to fix it for 2017 version by installing Microsoft building…
0
votes
2 answers

Can't start PyGame Zero (pgzrun) from cmd

I can't start PyGame Zero window from cmd. According to book I bought my kid, I suppose to start it with pgzrun test.py Unfortunteally what I get is: 'pgzrun' is not recognized as an internal or external command, operable program or batch file. As…
Tomek
  • 701
  • 2
  • 8
  • 20
0
votes
0 answers

Python Pygame Zero: Stuck on Not responding

so I was programming with Python, specifically Pygame. I came across a few problems, which I have fixed. But my latest problem, is that when I ran the game, the window is only black. when My code so far is this: import pgzrun #import pgzero from…
Azbojrn
  • 1
  • 1
0
votes
0 answers

How to display the inscription and pause the game in Ping Pong with pgzrun in Python

My code ` import pgzero.music import pgzrun import pygame import time from pgzero.actor import Actor WIDTH = 600 HEIGHT = 700 RED = 200, 0, 0 Darkviolet = 104, 34, 139 COLOR1 = 71,60,139 WHITE = (255, 255, 255) BOX = Rect((20, 100),…
Igor
  • 1
  • 1
0
votes
0 answers

Blit is not detecting my Player classes self.pos

My code: import pgzrun, pgzero, pygame, math, time, random, os from pgzero.builtins import Actor, animate, keyboard screen = pgzero.screen.Screen # screen WIDTH = 800 HEIGHT =…
0
votes
0 answers

TypeError: unhashable type: 'PngImageFile' - How do you fix this error in Pygame Zero?

I am making a game using pygame zero. I am using replit and getting the following error: Traceback (most recent call last): File "main.py", line 97, in cell = Actor(cell) File…
0
votes
0 answers

Play Stuck on floor after giving it a Model

Hey I managed to give my player a picture as model, but now my jump isn't working. What did I do wrong? It's Stuck on the floor We have got this projekt pre coded and firt i changed that the player is not just a rectangle. Now it´s a picture but the…
0
votes
0 answers

Pygame Zero only showing some of the background

I haven't found a question anywhere else which matches mine, but sorry in advance if I'm duplicating. I am doing a python course and I am making a game with pgzero. I have not completed it, but I have this issue, where it doesn't display the full…
Aahan
  • 1
  • 3
0
votes
1 answer

Thonny: No module named 'pgzrun'

I've been successfully using Thonny with Pygame and Pygame Zero for a while. Work upgraded the PCs to 4.0.0 (Python 3.10.4) and now I get the following error: import pgzrun ModuleNotFoundError: No module named 'pgzrun' I upgraded Thonny on my own…
wibbleface
  • 119
  • 14
0
votes
1 answer

screen: Any "screen" is not defined in pygame zero

I'm coding a simple quiz game with pygame zero and pygame. But somehow the screen is not defined. I'm very new with coding so I mostly rely on stackoverflow. Didn't find anything that answers my question. I'm using the book "Computer Coding Python…
Legalybis
  • 1
  • 1
0
votes
1 answer

Transparent rectangles in PyGame Zero

I'm using screen.draw.rect() to draw rectangles with PyGame Zero. They will be used as a collision map on a game. I can't work out how to make them transparent though. The only documentation I can find is for the standard PyGame library, which is…
wibbleface
  • 119
  • 14
0
votes
0 answers

Python hand recognition

for my last year in high school i need to make this project. It is the game "pong" but instead of buttons you use your hand to move the paddles. I tried writing the code but i am stuck, it recognizes my hand but the ball and paddle only move 1 step…
0
votes
2 answers

python ModuleNotFoundError: No module named 'pgzrun'

I have a problem with python programming, when I'm trying to write a game, it says: No module named 'pgzrun',but I had already install pyzero.On windows,it works perfectly,but on my macbook,it could not work.I has serched it for nearly two…
0
votes
1 answer

How can I hide and show actors in python

So there's this game I'm making and I have the play button as an actor, how do I make it so that when I click it, it disappears? Using pgzero on windows. PS: I have everything down but the disappearing part. playbox = Actor("playbox") createbox =…
janajayjana
  • 3
  • 1
  • 4
0
votes
1 answer

How do we tell if two sprites are colliding in Pygame Zero?

I recently started coding in Pygame Zero before starting Pygame. I was making a game and the I need to see if two of the sprites are colliding. How should I approach this? The two sprites: [1]: https://i.stack.imgur.com/bRcqC.png [2]:…