正规365体育投注

Questions tagged [pygame]

正规365体育投注 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.

Filter by
Sorted by
Tagged with
0
votes
0answers
9 views

Chrome extension with pygame source code?

I am currently coding a simple game using the pygame library with python. Is it possible to make this game a chrome extension considering pygame must be downloaded via a pip install command? I'm aware ...
0
votes
0answers
11 views

How to get value of the click button in python using pygame

I am newbie to Python and I am trying to develop a small game. I have an app class and buttons class and I would like to get the value of the button clicked and add it to the selected position on the ...
0
votes
0answers
17 views

Python Pygame empty window

Window I have an entirely work code cause i ran it in Windows 10. I use Pycharm with Python 3.7. There are a virtual environment and i download all of libraries for this project successfully. Can ...
0
votes
0answers
10 views

How to properly play music in pygames to not occur pygames.error?

I have a simple script that is checking whether there is a pop-out message on the site, if there is it will click it and then play music. I tried with many libraries but only pygames mixer worked for ...
0
votes
0answers
12 views

Pygame motion(mechanics) : Why does my player never come back to the ground?

I already did a jumping system which is working, but i have to do one using mecanics. At the moment my character never come back to the ground. Here is my code : def jump(self): if self....
0
votes
1answer
17 views

pygame pacman I want to know the meaning of the code

It's a function that got Ghost to follow player, but I don't understand. I want to know the meaning of the code. def followPlayer(g, dirs): d = ghosts[g].dir if d == 1 or d == 3: ...
-1
votes
0answers
14 views

Cannot find pygame png images [closed]

New to programming. I have tried all sorts of solutions to my pygame.error: Couldn't open background.png issue to no avail. I have narrowed it down to the png files not being in the same folder as the ...
1
vote
1answer
26 views

Enemies won't go visible after health reaches 0 - how to fix?

In my main loop I add health for the enemy. If I keep hitting the enemy and the health drops to 0, the enemy should disappear (enemys1.visible = False). I ran the visible variable on my enemy class ...
1
vote
0answers
22 views

pygame pacman How 4 Ghosts Work Together to Catch a Player [closed]

I made the ghost move randomly. But I want to know that instead of moving around in a random way, four Ghosts can track the player. What can I do? def moveGhosts(): global moveGhostsFlag ...
0
votes
1answer
21 views

How to draw a closing view in pygame

I'm trying to make a simple game where, given some condition, the vision field of the character (always at the center of the screen) gets radially reduced until it totally closes and the game ends. ...
0
votes
1answer
10 views

Refreshing List of MIDI Input Devices

I'm using pygame's MIDI module to collect a list of available MIDI input devices. I'm using a method inside a custom-built class to generate this list like so: def create_devices(self): ...
1
vote
1answer
22 views

Projectiles After Colliding With Enemy Problem How To Fix?

I am trying to make my bullets collide with my enemy and then dis-pear but it just passes throw them for some reason for bullet in bullets[:]: if bullet.y + bullet.x < enemys1.hitbox[1]...
-3
votes
0answers
17 views

why dosnt a hitbox appear in python [closed]

what is wrong with this ? i have watched tutotials but i still cant figure the one out i want a hitbox to appear, am i doing it wrong or is it an easy fix i made a class and defined draw, and now i ...
0
votes
1answer
34 views

Can anyone tell me how to make the printed screen blue?

This is the original question: As shown above, I need to print a blue screen. This is what I did: import pygame pygame.init() blue = (0, 0, 255) size = (width, height) = (640, 640) screen = ...
0
votes
0answers
38 views

How to store multiple objects in a variable in python and pygame

I'm making a game where a spaceship shoots at aliens. The problem is that when I call the shoot function twice I don't get two projectiles, but one get destroyed. I think I have to store the two ...

15 30 50 per page
1
2 3 4 5
884