Skip to main content

Questions tagged [pygame]

A game development library based on the Python programming language. It wraps SDL for easy use alongside Python.

Filter by
Sorted by
Tagged with
23 votes
2 answers
22k views

Is there such a thing as a short answer on how to do a Mode 7 / mario kart type effect in pygame? I have googled extensively, all the docs I can come up with are dozens of pages in other languages (...
2D_Guy's user avatar
  • 231
19 votes
3 answers
9k views

Background I run a minecraft server where I'm going to design a starter city of fairly large scale. I have a series of things, like rule signs and mob cages, I would like to put in buildings there. ...
Ken's user avatar
  • 870
18 votes
2 answers
6k views

I'm trying to develop a simple game made with Pygame (Python library). I have a sprite object which's the player and I move it ...
Drumnbass's user avatar
  • 295
10 votes
6 answers
23k views

By profiling my game, I see that the vast majority of the execution time of my hobby game is between the blit and the flip calls. Currently, it's only running at around 13fps. My video card is fairly ...
Smashery's user avatar
  • 375
10 votes
2 answers
985 views

This is a follow-up question to this other one. I would like to know if there is a common/typical/best pattern to scale my representation of the world (currently 160Kmx160Km) to fit it to the drawing ...
mac's user avatar
  • 1,375
10 votes
1 answer
57k views

I just got Python 3.5 from this link. Previously I had Python 3.4 and the Pygame version 1.9.2a0. It worked perfectly. However, my the new Python 3.5 isn't compatible with that version of Pygame that ...
EdinsonC's user avatar
  • 171
9 votes
2 answers
10k views

I'm working on a 2d sidescroller in PyGame. For each map we use one texture (this is the actual size of the texture): Then we load the image with this code: ...
orlp's user avatar
  • 364
9 votes
4 answers
3k views

I'm playing around with PyGame. Now I'm trying to implement a QIX clone. I have my game loop, and I can move the player (cursor) on the screen. In QIX, the movment of the player leaves a trace (...
astropanic's user avatar
8 votes
5 answers
7k views

Are there any good, modern widget toolkits for Pygame? I've looked at PGU, but it's apparently unmaintained.
Nathon's user avatar
  • 265
8 votes
2 answers
31k views

I am having trouble setting up the frame rate in my first game. I know that I can set it up with: clock = pygame.time.Clock() clock.tick(60) but this is not ...
DragonDePlatino's user avatar
8 votes
4 answers
18k views

Recently I have returned to my childhood hobby (programming games) and found it quite enjoyable. I've been tinkering with PyGame (for Python) for a few months, made a couple of projects for ...
HamsteR's user avatar
  • 91
7 votes
8 answers
17k views

i'm learning something about game programming from a book about "pyGame". pyGame is simple, but... python is a little complex and different from my previous knoweledge about programming. I know "...
stighy's user avatar
  • 477
7 votes
2 answers
29k views

I have a Pygame game, and I was wondering if there was any way to embed it into a webpage to make it easily playable, or if there is a games website that accepts Pygame games. EDIT: I am now using ...
user19642323's user avatar
7 votes
1 answer
5k views

I have a situation in which two rectangles collide, and I have to detect how much did they collide so I can redraw the objects in a way that they are only touching each other's edges. It's a ...
TheMeaningfulEngineer's user avatar
6 votes
1 answer
2k views

I am trying to position some text on my screen using pygame, and knowing the size of the string would help. When using C# and XNA I could use ...
sec_goat's user avatar
  • 207
6 votes
2 answers
5k views

I'm trying to create a simple top-view 2D rpg, in the style of Zelda and Secret of Mana, using PyGame. I've managed to make the beginnings of a game, with an animated character walking around. However,...
Tor's user avatar
  • 193
6 votes
2 answers
1k views

Is there a recommended way to write reuseable components for pygame? Simple example would be a FPS counter. Should I write a class which has an init, update and draw method and call them from inside a ...
apparat's user avatar
  • 163
5 votes
3 answers
26k views

i seem to have a conceptual misunderstanding of the surface and rect object in pygame. I currently observe these objects this way: Surface Just the loaded image rect the 'hard' representation of the ...
TheMeaningfulEngineer's user avatar
5 votes
4 answers
21k views

Here's my code: ...
Ericson Willians's user avatar
5 votes
1 answer
2k views

I've been trying to get tile marching to work like in Terraria, and I got something to work. I don't think it's actually very good way of doing this, so I'm wondering what would be really the main way ...
user avatar
5 votes
1 answer
13k views

I have created several simple games with PyGame, but until now, I have focused on mechanics rather than graphics. The graphics in my games have been extremely rudimentary, consisting of basic shapes ...
user avatar
5 votes
2 answers
746 views

When I press a keyboard button on a keyboard with a Russian layout, my application pygame game crashes with this message: UnicodeEncodeError: 'ascii' codec can't encode character '\u0444' in ...
Vlad's user avatar
  • 101
5 votes
2 answers
3k views

I'm generating large amounts of procedural map data on the fly, however my game engine doesn't rely on them to render the scene and I'd like to build it on in the background and pop it into the world ...
salmonmoose's user avatar
5 votes
2 answers
2k views

I am developing simple 2D environment in Pygame (Python 3.6), however I think this question is general. The environment is moving (player is rendered on the same position and everything else is ...
matousc's user avatar
  • 159
5 votes
1 answer
1k views

So I'm trying to code a game using the Model-View-Controller pattern, and therefore have a need to separate the models for my game objects with their sprite representations. The problem that I'm ...
Ceasar's user avatar
  • 153
5 votes
4 answers
18k views

I'm using cx_Freeze to package my PyGame game. I'm running Ubuntu Linux, so I used the source package. However, I got the following error when I run cxfreeze game.py...
elijaheac's user avatar
  • 199
4 votes
5 answers
2k views

Using python and pygame I've built a collision detection system according to the instructions in this YouTube tutorial. This is updated 40 times per second and controls movement and collision ...
Anonymous Entity's user avatar
4 votes
6 answers
22k views

I've been writing a simple top down mini RPG in python. My problem is that when I move the player I have to repeatedly tap the arrow key. Each time I tap the key the player moves 5 PX in the ...
Cnorwood7641's user avatar
4 votes
2 answers
2k views

I'm trying to create a turn-based game in pyGame but hit a wall when trying to properly handle the main game loop. So I have something like this: ...
Straightfw's user avatar
4 votes
1 answer
2k views

So I'm attempting to learn Python by way of Minesweeper. I've got experience with SDL, so I figured playing around with PyGame sounded like a fun way to learn the syntax of the language. Anywho, I'm ...
erik's user avatar
  • 1,378
4 votes
2 answers
3k views

This question in very similar to this question, however I am still confused about how one would implement a story and quests in a finite state automaton RPG. This is my first game that I am making (...
James's user avatar
  • 183
4 votes
1 answer
8k views

Code: ...
Flutterguy135's user avatar
4 votes
1 answer
2k views

I'm trying to figure out a way to move an object in a circular path. I read about Bresenham's circle algorithm, but all the codes available online draw an entire circle. For my game, I want it so ...
rcs's user avatar
  • 41
4 votes
2 answers
2k views

I am developing an action platformer in Python, with Pygame. That said, my question is a general one about collision resolution strategies. I use an axis-aligned bounding box for the purposes of ...
DyingIsFun's user avatar
  • 1,337
4 votes
1 answer
3k views

I'm having problems with quitting a Pygame application (6502 based computer emulator). The part regarding exit looks like this: ...
Hrvoje's user avatar
  • 221
4 votes
3 answers
21k views

I'm having a strange issue that I cannot seem to remedy. I am doing some prototyping with Pygame on a desktop running windows and a laptop running OS X. Both are running python v2.7.3 (installed via ...
Nathan Chowning's user avatar
4 votes
2 answers
17k views

I am trying to understand how pygame surfaces work. I am confused about Rect position of Surface object. If I try blit surface on screen at some position then Surface is drawn at right position, but ...
Jaka Novak's user avatar
4 votes
1 answer
573 views

I'm trying to program a shooting function in my game using pygame. Process: Player one will press 'Space' and shoot their type of projectile Player two would press 'E' and shoot their type of ...
Mercury Platinum's user avatar
4 votes
2 answers
4k views

I am trying to make bullets bounce of walls, but I can't figure out how to correctly do the collision detection. What I am currently doing is iterating through all the solid blocks and if the bullet ...
Serial's user avatar
  • 238
4 votes
1 answer
244 views

So I am making a simple game. I want to put a gun on top of a car. I want to be able to control the angle of the gun. Basically it can go forward all the way so that it is parallel to the ground ...
Blair's user avatar
  • 41
4 votes
1 answer
288 views

I am working on a small game that deals the main character, which is a cat, and dogs that chase it. The dogs are able to wander around like they are supposed to do, but the cat will only move a small ...
Taylor's user avatar
  • 41
4 votes
2 answers
6k views

I am working on a game(a platformer) that is physics and momentum based. I want to make it so that the player(a single dot) can bounce off of the lines with correct physics, but to do that, I need to ...
user3339168's user avatar
3 votes
4 answers
4k views

I'm using pygame.rect.colliderect() to check hitbox collision between sprites in my game, but now that I'm rotating the sprites, I'm realizing I can't do this ...
user3150635's user avatar
3 votes
2 answers
19k views

I'm a bit puzzled about pygame's Surface.convert(): It's common sense that I should convert a surface after loading an image to it (presumably a jpg/png/etc file),...
MestreLion's user avatar
3 votes
3 answers
2k views

I am having a bit of a tooling problem...and I am unsure of how to solve it. I am currently using PyGame to try and write a simple Minesweeper clone, except my sprites that I made are hexagon based ...
erik's user avatar
  • 1,378
3 votes
3 answers
1k views

I'm a total noob with regard to game programming (though not a noob to programming) and I'm using pygame + opengl to do some experiments with a little game I've been thinking of. I've been trying to ...
malvim's user avatar
  • 193
3 votes
1 answer
4k views

What are the key differences between the Sound and Music classes in Pygame? What are the limitations of each? In what situation would one use one or the other? Is there a benefit to using them in ...
Southpaw Hare's user avatar
3 votes
5 answers
363 views

I was thinking of learning about making games, so I thought of an idea about making a game on a play, since the content is already there. I actually found well parsed XMLs of Shakespeare's plays. I ...
tavish's user avatar
  • 33
3 votes
1 answer
15k views

How can I load a GIF animation in pygame? With a web search, I found a severely outdated library called GIFImage. I tried it to do it with 2 pictures but I'm getting stuck because I'm a beginner. I ...
user2333167's user avatar
3 votes
2 answers
5k views

I making a small program to animate the astar algorithm. If you look at the image, there are lots of yellow cars moving around. Those can collide at any moment, could be just one or all of them could ...
iCodeLikeImDrunk's user avatar

1
2 3 4 5
10