Questions tagged [pygame]

Pygame is a set of Python modules designed for writing video games. Use this tag only if you are using the Pygame library and not if you have a question about programming a game in Python in general.

0 votes
0 answers
7 views

PyGame background color is not changing

I cannot find, what is wrong with background, even with debugger it is not doing nothing #importing from turtle import width import pygame #resolution pygame.display.set_caption("Tanks") ...
user avatar
  • 1
0 votes
0 answers
6 views

pygame blit collision detection [duplicate]

i have 2 blits that i want to detect if collided i have the list ready but i have only done collision on rectangles and don't know how to do it on 2 blits anyone here knows the command? I have tried ...
user avatar
0 votes
0 answers
10 views

Pygame Icon Not Displaying In Ubuntu Linux [duplicate]

Ubuntu 20.04.4 LTS Python 3.8 PyCharm 2022.2.1 (Community Edition) I'm trying to create a window and have an icon with title displayed. The window and title work fine but the icon isn't displaying. ...
user avatar
0 votes
1 answer
26 views

Pygame.rect x and y values not accesible

So i was following a pygame tutorial and after showing the sprites and scaling the with the pygame.image.load() and the pygame.transform.rotate(pygame.transform.scale)) he then makes some rectangles ...
user avatar
  • 1
-2 votes
0 answers
31 views

Which topics do i need to know for making snake game in python [closed]

I have started learning python recently(Now i am learning the OOP), and i have a question. Which topics do i need to know for making a snake game in python.
user avatar
0 votes
0 answers
22 views

How to copy an object that contains a pygame surface? [duplicate]

I'm programming a game similar to solitaire with Python3 and Pygame. The whole game is contained in a environment to keep track of where all the cards are at all times and to make it easier to display ...
user avatar
  • 1
0 votes
1 answer
35 views

How to move a stationary object towards another object which moves when you press a key

I am trying to recreate the game Ballz! in Pygame, and I'm having a difficult time trying to get the ball that you shoot go in the right direction (the direction of the "aiming balls"). I am ...
user avatar
  • 27
2 votes
1 answer
43 views

Is pygame volume linear or exponential?

I read that a common mistake in game development regards the volume option. It showed how a derease from 100% to 50% volume is decreasing by half, but then 10% to 0% is a decrease by 100%. In essence, ...
user avatar
  • 35
0 votes
1 answer
40 views

how do i make sprite "igirl" move randomly

The code inside the update function for "Igirl" does nothing and I'm not sure why, also not sure if the rest of the code is needed to help find a solution. I've tried putting the random ...
user avatar
-2 votes
0 answers
27 views

can anybody help me with a direction in pygame please? [closed]

Hi! I have a problem. I want the zombie after spawning at random place, to go towards the player but I don't know how to do it ? I tried Everything Can You Help me please ? Code: import pygame import ...
user avatar
  • 1
0 votes
0 answers
29 views

How to pause a continuously increasing variable (for example, time) and wait for an input to resume in PyGame [duplicate]

So I'm making a game using PyGame and right now I'm setting up the pause menu. In the game itself, the time displayed will be ever-increasing (from 6AM incrementing by x minutes every y seconds, until ...
user avatar
  • 1
-2 votes
0 answers
41 views

TypeError: argument 1 must be pygame.Surface, not Boss

I wrote code for a plane/boss game. The error TypeError: argument 1 must be pygame.Surface, not Boss is coming up. Anyone know how to fix it? This is my code import pygame background_colour = (0, 0,...
user avatar
0 votes
2 answers
34 views

Pygame Window Closes after Being Opened

I'm making a article generator, however, when I run the code, the Pygame Window opens, the closes before anything happens, Ive tried adding input() but no text shows up anyways. import pygame import ...
user avatar
-1 votes
1 answer
19 views

Trying to make a flappy bird type movement pygame window [closed]

i am trying to make a flappy bird movement that moves the rect forward and down at the same time but after implementing it. The rect on the pygame window doesnt appear and the window crashes. I tried ...
user avatar
1 vote
3 answers
47 views

How to get a character walking in pygame?

I would like to get my pygame character walking. I tried everything but it's not moving. The player().x is not moving. What can I try next? import pygame pygame.init() WIDTH, HEIGHT = 1920, 1080 ...
user avatar
  • 11

15 30 50 per page
1
2 3 4 5
1278