Questions tagged [pygame2]

The PyGame 2.0 version. PyGame 2.0 is backward-compatible along with Python 2 support.

The PyGame 2.0 version of PyGame. Released on October 28, 2020, PyGame 2.0 is backward-compatible along with Python 2 support.

References:

58 questions
0
votes
1 answer

Trying to prevent player from moving through tile Pygame

I've been working on collisions in Pygame and the issue is that when the player moves lands of the top of the tile they are immediately blitted onto either the left or the right. How would I make it so that it the player lands on top of the platform…
0
votes
1 answer

How would I randomly rotate and scale each sprite created from a class in pygame

I am trying to clean up my code, and am moving scripts to different files. I want put my image (in this case, meteors) in random places, with random rotation and size. I can get it to go to random places, but just can't figure out how to scale and…
0
votes
1 answer

What's difference between .get_rect() and pygame.Rect()?

I have seen image.get_rect() and pygame.Rect() being used in different programs.How do they exactly differ from each other.Don't both of these codes are used to set a rectangular boundary around a surface/image or are they different?
0
votes
1 answer

What is Pygame.Rect() is used for in a program?

Can anyone tell me the use of Pygame.Rect. I am creating a simple program to draw and display rectangle in screen and check for collision with screen. I saw a video on youtube where the Youtuber uses the following…
0
votes
2 answers

What is the difference between pygame.Rect() and pygame.draw.rect()?

I was learning to create a simple Pygame window which displays a Rectangle. I watched two different videos on Youtube. One of the Youtuber used Pygame.draw.rect() to create a rectangle whereas other Youtuber used both pygame.Rect() and…
0
votes
0 answers

pygame 2.0.0 not creating a window (in sublime)?

I just updated to pygame 2.0.0 and tried to run this basic window: import pygame,sys pygame.init() screen = pygame.display.set_mode((800,800)) clock = pygame.time.Clock() while True: for event in pygame.event.get(): if event.type ==…
Another_coder
  • 728
  • 1
  • 9
  • 23
0
votes
1 answer

How to resize window in pygame (python3)

I'm making a game and I want to be able to resize the window, so I set the screen to screen = pygame.display.set_mode((width, height), pygame.RESIZABLE). I have a function call resize() that updates the positions of the all the images too. def…
FluffyFlounder
  • 140
  • 2
  • 8
-1
votes
1 answer

Pygame on Raspberry Pi - no driver

I got a problem with setting up my Pygame code on RasPi 4. I have HDMI display (7" for now, later to be replaced by 4" on final product) connected to it (boot to console), but do all development on remote desktop. When I use pygame 1.9, i have no…
Petr Osipov
  • 621
  • 6
  • 16
-1
votes
0 answers

Program won't load pygame

I am trying to add a menu on my pong game but when I try to load the program the window doesn't show up and it doesn't see any error so I don't kwon where the problem is. Here is my full code if something is missing so it can be seen. The game is…
-1
votes
3 answers

How do I prevent the player from moving through the walls in a maze?

I have a maze organized in a grid. Each cell of the grid stores the information about the walls to its right and bottom neighboring cell. The player is an object of a certain size whose bounding box is known. I want to move the player smoothly…
Rabbid76
  • 202,892
  • 27
  • 131
  • 174
-1
votes
1 answer

how to compile pygame in python 3

I don't know exactly the Error of this code I didn't get any Error but my code doesn't execute. when I ran my code just I saw the rect's code run and after runing just I saw yellow rectangel in screen, the code-related print text doesn't…
-1
votes
1 answer

i've been trying to make a python snake game with python but i keep on getting "pygame not initialised" error

I've been trying to make a python snake game with python but I keep on getting "pygame not initialized" Error :
-2
votes
1 answer

How to make a hole in a pygame surface?

I have 2 different images A and B, B is blit on top of A. I'd like to have (blit I guess) a hole in B that lets me see A through it. Can anyone help me with that? Thanks in advance.
ToeTeo
  • 1
1 2 3
4