pygame Questions
1
import pygame
WIDTH, HEIGHT = 1024, 768
pygame.init()
WIN = pygame.display.set_mode((WIDTH, HEIGHT))
skala = pygame.image.load("rock2x3b.jpg")
play = True
if __name__ == "__main__...
Sellars asked 24/8, 2023 at 5:37
5
Solved
I'm having a problem. I want to load and play a video in pygame but it doesn't start. The only thing that I am seeing is a black screen. Here is my code:
import pygame
from pygame import display,m...
2
Solved
I know this may sound stupid, but the pygame documentation on their website says that it is:
x = pygame.Rect(left,top,width,height)
However, in my program, I cannot figure out if that is true, o...
5
Solved
I'm using the pygame module on VS Code and I ran into the issue where the pygame has not init member. I followed the solutions to this link. I edited the user settings and added
"python.lintin...
Dubuffet asked 29/1, 2021 at 5:36
3
Solved
EDIT: I found out that the error is that the resources couldn't be opened. Copying the directory into the folder where the .exe is didn't fix it. I tried removing the resources from the .spec file ...
Hieratic asked 15/12, 2014 at 14:57
2
Solved
I'm developing a grid based game in pygame, and want the window to be resizable. I accomplish this with the following init code:
pygame.display.set_mode((740, 440), pygame.RESIZABLE)
As well as th...
3
I'm learing Python and Pygame, and my first thing I'm making is a simple Snake game. I'm trying to make it so that the snake moves once every 0.25 seconds. Here is the part of my code that loops:
...
Youngs asked 22/9, 2013 at 21:34
12
Solved
I am making a game in pygame 1.9.2.
It's a faily simple game in which a ship moves between five columns of bad guys who attack by moving slowly downward. I am attempting to make it so that the ship...
12
Solved
I am trying to make a game and I am trying to render a lot of text. When the text renders, the rest of the text goes off the screen. Is there any easy way to make the text go to the next line of th...
8
Solved
I've found two related questions:
Pygame hold key down causes an infinite loop
pygame - on hold button down
But I want to be specific. How to?
while not done:
for e in event.get():
if e.type ==...
8
I've been learning python and decided to play around with PyGame. The PyGame window randomly stops showing up when I run the script. I don't get any errors or anything, the PyGame window just won't...
5
Solved
It sounds like a simple thing to do , but I'm struggling.
I have a png image of a rectangle with a transparent centre called "zero". I want to change the colour of the visible part of the image. To...
3
I am trying to create a basic snake game with Python and I am not familiar with Pygame. I have created a window and I am trying to split that window up into a grid based on the size of the window a...
13
When I import pygame, it prints the version and welcome message. The message reads:
pygame 1.9.4
Hello from the pygame community. https://www.pygame.org/contribute.html
Why is this printed?
How ca...
7
I've just started a little game project and I'm trying to make it play a sound everytime a bullet is fired but i keep getting the same error:
pygame.error: mixer system not initialized
I don't g...
3
Solved
I have a Win7 64 bit dev machine. I've downloaded and installed Python 2.6.6 32bit. I've also downloaded pygame 1.9.1 for python 2.6 and tried to install it. I got:
C:\pygame-1.9.1release>...
Maxima asked 11/9, 2010 at 13:39
3
Solved
Is there a feature similar to this in pygame?
screen.fill(pygame.image.load('brick.bmp').convert())
I would like to fill the window (background) with an image to produce an effect similar to th...
3
Solved
I'm having trouble with the following code. It seems to respond to the escape key but it freezes really bad. I'm using pyscripter with python 2.7 and pygame.
# An example implementation of the alg...
2
Solved
This is my code, which starts the webcam :
import pygame.camera
import pygame.image
import sys
pygame.camera.init()
cameras = pygame.camera.list_cameras()
print "Using camera %s ..." % cameras[...
2
28
I'm trying to install Pygame. I am running Windows 7 with Enthought Python Distribution. I successfully installed pip, but when I try to install Pygame using pip, I get the following error:
"Cou...
Patio asked 25/7, 2013 at 21:31
4
Solved
A friend and I are making a game in pygame. We would like to have a pygame window embedded into a tkinter or WxPython frame, so that we can include text input, buttons, and dropdown menus that are ...
3
I was trying to import pygames from python using Canopy firstly and after no success I tried from terminal and in both cases I get:
import pygame
Traceback (most recent call last):
File ""...
Bovid asked 1/6, 2015 at 7:44
7
This is my situation:
I tried importing pygame in both python 3.4.2 and python 3.6.3 using both pip and pip3 respectively.
In the python 3.4.2 shell:
Traceback (most recent call last) is:
F...
Isthmian asked 29/6, 2018 at 18:13
5
Hi I am having a problem with drawing a circle ERROR: module object has no attribute 'circle'. what am I doing wrong?
And also how can I put numbers in circles?
For example: (first click is circle ...
© 2022 - 2025 — McMap. All rights reserved.