Category : pygame

I installed a new version of IDLE, and I’m trying to install Pygame. I tried to use the pygame module, but when I did, the error message Traceback (most recent call last): File "C:UsersKidsDesktopPygame Space InvadersassetsPygame_Space_Invaders.py", line 2, in import pygame ModuleNotFoundError: No module named ‘pygame’ showed up. I’m fairly sure this is because pygame ..

Read more

I am trying to install pygame on my computer through the command pip install pygame but it is giving me this error: C:Usersusername>pip install pygame Collecting pygame Using cached pygame-1.9.6.tar.gz (3.2 MB) ERROR: Command errored out with exit status 1: command: ‘c:pythonpython.exe’ -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’C:UsersusernameAppDataLocalTemppip-install-8c4rjm0dpygamesetup.py’"’"’; __file__=’"’"’C:UsersusernameAppDataLocalTemppip-install-8c4rjm0dpygamesetup.py’"’"’;f=getattr(tokenize, ‘"’"’open’"’"’, open)(__file__);code=f.read().replace(‘"’"’rn’"’"’, ‘"’"’n’"’"’);f.close();exec(compile(code, __file__, ..

Read more

I am currently trying to program a version of Flappy Bird by following along a youtube video. At this point in the code, I should be seeing the flappy bird flapping its wings in place. However, I am getting this error instead: Traceback (most recent call last): File "/Users/USER/Desktop/flappy.BIRD/1.py", line 111, in <module> main() File ..

Read more

import sys, pygame from math import sin, cos, radians, pi from pygame.locals import QUIT, MOUSEBUTTONDOWN pygame.init() SURFACE = pygame.display.set_mode((780,920)) FPSCLOCK = pygame.time.Clock() def Line(): speed = 0 while True: for event in pygame.event.get(): if event.type == QUIT: pygame.quit() sys.exit() if pygame.mouse.get_pressed() [0]: speed += 26 if speed > 60: speed = 60 else: speed -= ..

Read more

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 resize(): width, height = pygame.display.get_surface().get_size() cookie_surface = pygame.image.load(‘/xxx/xxx/xxximages/cookie.png’) cookie_surface = pygame.transform.scale(cookie_surface, (275, 275)) ..

Read more

hi im making a game using pygame. it plays a game over music when player dies but it plays it multiple times i made the loops to 0 but it again plays it multiple times. and also you can check my youtube channel https://www.youtube.com/channel/UCUTsa7fpGtmspg_JOBE56aQ?view_as=subscriber sorry dudes but i have to write more to post my ..

Read more

I am trying to use pygame to display multiple pokemons on the screen and random points and they will descend on the screen. Here is the code. I am getting an error list object not callable in when I call poke(X,Y,img) #pokemons bullbasaur=pygame.image.load("C:userskhuhan rawatDesktoppokemonbullbasaur.png") charmander=pygame.image.load("C:userskhuhan rawatDesktoppokemoncharmander.png") dratini=pygame.image.load("C:userskhuhan rawatDesktoppokemondratini.png") eevee=pygame.image.load("C:userskhuhan rawatDesktoppokemoneevee.png") jigglypuff=pygame.image.load("C:userskhuhan rawatDesktoppokemonjigglypuff.png") meowth=pygame.image.load("C:userskhuhan rawatDesktoppokemonmeowth.png") pikachu=pygame.image.load("C:userskhuhan ..

Read more