A game development library based on the Python programming language. It wraps SDL for easy use alongside Python.
0
votes
0answers
12 views
Pygame camera scrolling
Right, so I'm trying to develop a Fire Emblem-style game, topdown view of a square-grid map using the pygame library.
I'm trying to implement a way for the camera to scroll when you hit the edges, ...
1
vote
0answers
28 views
If I create a pygame, can I later convert it to a .exe for everyone to use? [duplicate]
I was told if I create a pygame, other people would need python/pygame to actually run it. Is that true? Or is there a way I can later convert it to a .exe?
0
votes
2answers
40 views
How to make an object move outside the map and appear on the other side with a tilemap?
I have a tilemap where a character moves from tile to tile. I'm trying to make it possible for the character to move outside the screen and reappear on the other side, just like the tunnel in Pacman.
...
0
votes
1answer
47 views
Python collision left works, but not right
I am continuing to work on collision detection. It appears for the most part, everything I have implemented is working. When the game starts, the character is on the left side of the screen (plus a ...
0
votes
1answer
27 views
Python collision problem
I have a hero character with jumping physics that I am trying to figure out the collision detection for. Right now, the problem that I am running into is as soon as the character hits the floor (while ...
1
vote
0answers
19 views
SGC toolkit for PyGame and resizeable windows
Can I create a resizeable main window if I use the SGC GUI toolkit for PyGame? If so, how?
0
votes
0answers
26 views
Use a pygame surface as an openGL texture?
I've been trying to get a 2D image to draw on an OpenGL surface, and I've run in to similar questions answered with "Create an OpenGL quadrilateral and give it the image as a texture" but I can't find ...
0
votes
2answers
58 views
How should I make a jump-timing game's character static on screen?
I decided to learn Pygame and try to make a simple game inspired by Google's T-rex jump game. However, I stumbled upon a problem that I can not seem to figure out: How can I implement a scroller/...
0
votes
2answers
108 views
2d MMO world generation? [closed]
I am developing a MMO, and i'll describe it as a 2d mine craft (it's a lot more complicated than that). There will be a multitude of blocks that will be in a world. I need them to be randomly placed. ...
0
votes
1answer
77 views
Lag in collision detection
I am a beginner with PyGame and am currently making a simple game using but I am having difficulty with the collision detection. When the game runs, the response to the collision detection (printing ...
1
vote
0answers
42 views
How to initialize OpenGL context with PyGame instead of GLUT
I'm trying to start with OpenGL, using Python and PyGame.
I'm going to use PyGame instead of GLUT to do all the initializing, windows opening, input handling, etc.
However, my shaders are failing to ...
0
votes
2answers
45 views
How to rotate an image in pygame without losing quality or increasing size or moving position
I am trying to make a game in which I place a spaceship (its an image I downloaded) in the center and then rotate it on its place. However, when I use pygame.transform.rotate(), it rotates the image ...
0
votes
0answers
23 views
Pygame Vertical movement of a comet
I try to make a platform game where comets will collide as the character,this comet must fall from a vertical angle
This is my code:
# coding=utf-8
import sys
import pygame
import random
pygame....
3
votes
1answer
70 views
How to make a moving background with PyGame?
I'd like to create a moving background in my Python game, with an image, that moves up until it reaches the end, then it goes back to its first position. I'm still in my learning process and this is ...
4
votes
2answers
139 views
Implementing Story and Quests in RPG
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 (...
-1
votes
1answer
48 views
How to make a Infinite Verticle Scrolling Background in Pygame
Is there anyone who knows how to create an infinite verticle scrolling background in pygame?
Your help would be much appreciated, thanks in advance!
2
votes
2answers
83 views
Pygame: Collision detection
i've been adding some extra stuff like Gravity and a table to a simple pong game made with Pygame and Python, the problem is that i dont know how to add collision detection, so when the ball hits the ...
0
votes
1answer
108 views
How to program destructibles?
I'm thinking about programming a 2d simulation of a spaceship that takes damage depending on where the projectile came from (e.g. from behind - engine, from the front - lasers, sides - hull, etc.). ...
1
vote
0answers
79 views
How to integrate Tiled maps and collision detection with pygame?
I have been using pygame to make a simple rpg pokemon style game. To create maps I have used the Tiled map editor and then loading them into pygame using pytmx.
I have heard that you can add object ...
0
votes
0answers
34 views
How To Point An Object At Cursor? [duplicate]
I'm trying to make a Nuclear Throne like game in python 3 and pygame, but I got stuck at how to make the gun point at the cursor. If someone could show me how, that would be great. :D
I looked at the ...
0
votes
4answers
133 views
PYGAME: When I release two directional keys together the player keep moving
I did the code this way to avoid the player to stop if a press two directional keys together making the movement more smooth. It works well but when I release two keys or more together the player keep ...
4
votes
2answers
112 views
Line Collision In Pygame?
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 ...
1
vote
3answers
128 views
Rotating hitboxes in PyGame?
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 because there's no way to rotate a PyGame ...
0
votes
2answers
101 views
Fast Flood Fill in Pygame?
I am creating a simple game in Pygame for my kids. It involves intersecting random complex curves. Some of the intersections can be coloured in different colours. I have implemented a flood fill ...
1
vote
1answer
66 views
How can I take a screenshot of a certain part of the screen in PyGame?
I need to for my pixel art tool that I'm making to help myself make games.
0
votes
0answers
50 views
Pygame image blitting makes game lag
So I have a tile-based game that is 216X384 units large. Each square in the cell_array is grass, which I pre-loaded with convert_alpha(). Each time it draws (I have fps at 30), it cycles through the ...
0
votes
0answers
24 views
Pygame Colorkey works on the image surface but not on the screen
I running pygame on python 3.2.3 and trying to make a pygame 3 Agar clone.
I've created simple sprite objects using draw.circle and drawn them to their own surface called image. I've then used ...
1
vote
1answer
82 views
How to figure out which tiles are within view, and where to draw them in the grid?
I know there are a few questions on here similar to mine, but none of them seem to fit my needs.
I'm using PyGame to implement a tile based game similar to Final Fantasy or Zelda from the early ...
-1
votes
1answer
47 views
How do I get a vector from an angle?
I want a ship to move forward in the direction it's facing when you press the up key, but I don't know how to get a normalized vector from the angle the ship is facing. Can someone show me what code ...
2
votes
1answer
323 views
PyGame for Python 3.5
I am running Python 3.5 and I want to install PyGame, the website only supports up to version 3.2. I have tried a few forums on this and other websites but they are all for Python 3.4. Does anyone ...
1
vote
1answer
60 views
Pygame time.get_fps() value
I was looking at the pygame.time.Clock.get_fps() method and after puting it inside of the while loop printing and checking it some times, i see that i starts to give its value after five frames (and ...
1
vote
1answer
154 views
What Is A Good Way To Make A Self Updating Game? (Python) [closed]
I've been making games and I have always had a problem if I wanted to sell a game. People would have to re-buy games to get the updated version. Does anyone have any ideas on how to make a self ...
0
votes
0answers
46 views
how to increase lenght and make body of snake in pygame
I'm programming a snake game and I'm not sure how increase the length of the snake.
Main part of code:
lead_x=300
lead_y=300
dirx=right(default)
if dirx=='right':
lead_x +=...
0
votes
2answers
33 views
(Pygame) Sprite disappearing on collision
I am making a game, and when the player runs into a certain block it changes the size of a circle on the top. The problem is, whenever the player runs into the block it disappears. How can I fix this?
0
votes
1answer
51 views
Remove bullets from sprite Group
I'm having an issue with removing objects from a sprite Group. What is happening is I have a bullet class and every time the user presses the player shoots a bullet. I have 'alive = bool' code and ...
0
votes
0answers
41 views
How can I make bullets go to the cursor in Pygame properly
So hey, I'm new into making games and programming at all, I tried to make a small game thingy in Pygame that would include a dude shooting bullets and stuff. However, I can't really get the shooting ...
0
votes
1answer
44 views
Pygame making Snake, need help with generating fruit with a random color
This is my function for generating an apple, I want it to generate a random color each time the snake eats it.
def AppleGenerator():
fruit_colors = [crimson,powderblue,yellow,hotpink,...
1
vote
1answer
29 views
Text blits to screen at wrong y-coordinate
I have a program that is meant to scroll numbers/letters down the screen, like in the movie "The Matrix". When one of the columns reaches a letter in the user's name (obtained using user input), it ...
2
votes
1answer
157 views
Pygame freezing on QUIT
I'm having problems with quitting a Pygame application (6502 based computer emulator).
The part regarding exit looks like this:
while True:
do_something_200_times()
for event in pygame.event....
2
votes
0answers
47 views
Does the latest version of Python have libraries for easy host/server connections? [closed]
We're working on a turn-based multiplayer Risk-type strategy game in Pygame, and I was wondering if there were any pre-existing libraries like PodSixNet that worked for Python versions 3 and up that ...
2
votes
1answer
171 views
Move an enemy towards the player in pygame
I set variables for the distance between the enemy and the player along the x-axis and y-axis. My plan is to move the enemy along the hypotenuse formed by y and x-axis line at a constant speed. The ...
0
votes
1answer
160 views
How do I check if pressed on a text in pygame?
How do I check if pressed on a text?
This is how I draw the text:
# Full code on https://github.com/Zwengel/bunny-badgers
height = pygame.display.Info().current_h
font = pygame.font.Font("...
0
votes
1answer
154 views
how to generate road in racing game
I'm making a racing game in python and I kind of wrote myself into a corner. This for loop:
for i in objects:
if i.name == "road":
if i.y == 0:
road = Road(road_x,-...
1
vote
1answer
509 views
Pygame Fullsreen Display Issue
Code:
import pygame
pygame.init()
#
def Main(display,colors):
clock =pygame.time.Clock()
#
surface = pygame.Surface(surface_resolution) # Create main surface
surface.fill(colors["RED"]...
0
votes
2answers
81 views
Pygame Scrolling Camera bug
I asked a question the other day about how to implement a scrolling camera. I got a great answer which helped me achieve that... but in doing so I have lost basically all collision detection. ...
1
vote
2answers
811 views
Pygame - implementing a scrolling camera
I am currently making a 2d game in Pygame and have run into a roadblock trying to make a scrolling camera (follows the character). I have seen some other answers to similar questions, but they have ...
1
vote
1answer
71 views
scrolling ruining bullet physics
the code below is the bullet class for my shooter game in pygame. as you can see if you run the full game (https://github.com/hailfire006/economy_game/blob/master/shooter_game.py) the code works ...
0
votes
1answer
128 views
How do I get pygame to work on intel processor?
I downloaded Python 3.4 64 bit IDE and pygame but whenever I tried installing pygame it would say "Not supported on Intel".
So are there version of pygame available for Intel processor or are there ...
0
votes
1answer
312 views
Diagonal Movement with Pygame Rect Class
I have been using pygame and have been struggling to understand how to implement vectors and the pygame rect class to make an image move diagonally on the screen at the correct speed.I know it must be ...
0
votes
1answer
40 views
Pygame.display.set_icon unable to show transparecy
On Python 3.2.5 32 bit, I installed pygame. I made some code with it. It included pygame.display.set_icon(image). The image file is .png and I loaded it by using image = pygame.image.load("clockico....