Linked Questions

1 vote
1 answer
20k views

I keep getting this error. Here's the full traceback. Traceback (most recent call last): File "C:/Users/Luc/PycharmProjects/game_practice/game.py", line 23, in <module> run_game() File "C:/...
Luc Larson's user avatar
2 votes
2 answers
1k views

I am trying to make a canvas for pixel art. class Canvas: def __init__(self): self.__blocks = [] self.__positions = [] for i in range(1830): self.__blocks....
user avatar
0 votes
1 answer
614 views

import pygame import os pygame.init() # Images bgImg = pygame.image.load("Images/background.png") playerImgRight = (pygame.image.load("Images/playerRight.png")) playerImgLeft = ...
Elfed's user avatar
  • 23
0 votes
1 answer
401 views

I am creating a game where the player moves around a grid and dodges rocks, but my code for detecting collision doesn't seem to work. import pygame from pygame.locals import * import random pygame....
Shgaug's user avatar
  • 11
1 vote
1 answer
203 views

I don't get why whenever I execute the program and my character collides with the star, it does not execute the following codes? What happens is that it executes the code already even if they are not ...
annyeongkre's user avatar
-1 votes
1 answer
194 views

I have been trying to use Pygame collision, but nothing I have tried has works. Now I have ended up with this: player_collison_box = player.get_rect() hole_collision_box = hole.get_rect() if ...
Duck Duck's user avatar
  • 164
1 vote
1 answer
213 views

blob image is not showing in the screen at the desired position, but it is showing at the top left of the screen . There are no error messages showing on the consol. if you know the solution plaese ...
Ankur Rawat's user avatar
1 vote
0 answers
199 views

I apologise if you have seen a post of mine regarding this issue already, I am desperate to solve this. I am creating a 2-player top down racing game and need to create a way for the program to know ...
RossC's user avatar
  • 99
0 votes
1 answer
151 views

I want to make it kind of like a life system so that if it collides with the enemy 3 times it will quit pygame.init() screen_width = 800 screen_height = 600 window = pygame.display.set_mode((...
Adam Ksouri's user avatar
1 vote
2 answers
144 views

I am developing an idle clicker game for a school project. There's a button that you can click on to upgrade your clicking power, but the rectangle assigned to it is in the wrong place. The button's ...
Oxnvat Wakkopocalypse's user avatar
1 vote
1 answer
66 views

So I'm a beginner at making games with python PyGame and I am trying to write a function to detect collision. Here is the function I currently have: def collision_detection(rect, h2w1_1, h2w1_2, ...
GGberry's user avatar
  • 945
1 vote
0 answers
57 views

I used a working version of a movement system that I had used before. In the working version, pressing wasd will move the player. However, I switched the player class to a sprite when adding collision ...
Karsonthefoxx's user avatar
1 vote
1 answer
53 views

Hey i'm a beginner to pygame and I have just started building games but I got stuck at this game and I'm not able to figure out what I am doing wrong.I have made a game in which car gets charged ...
Sva Sva's user avatar
  • 41
0 votes
1 answer
45 views

I am trying to make a basic game where the goblin moves from left hits the side then goes back again. I am trying to check if the player sprite is overlapping with the goblin sprite when the player ...
b9e's user avatar
  • 11
-1 votes
1 answer
16 views

So I'm trying to check im my bird images are touching my could images and if they are to print print('Collided1!'). My Issue is that print('Collided1!') goes off no matter what and is not checking ...
G U I's user avatar
  • 15

15 30 50 per page