Python is a dynamically and strongly typed programming language that encourages readability.
1
vote
1answer
12 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 ...
1
vote
1answer
17 views
Distance to rect edge from point based on direction
I have a rect that is at position (0,0) at the top left and is 2200x2200 in size.
I am trying to specify the the distance to get to the edge of the rect in specific direction (degrees) from a point ...
2
votes
1answer
40 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 ...
2
votes
1answer
37 views
AI on a 2d grid in python
I'm trying to figure out how to do a simple search/chase AI.
I know that I'm going to have to search around the mob entity to figure out if the player is close enough, I could probably get that done ...
2
votes
0answers
20 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 ...
1
vote
3answers
82 views
Making games In Python [closed]
I'm a beginner at making games, and my eBook that I learnt Python from just made a 2D game and simple game like snake in Nokia because I want to know more Python in correlation with game development.
...
0
votes
3answers
55 views
how to avoid circular references between objects and map
I've been working on a turn based tactics game on a grid. I've been trying to figure out how to store and relate the grid and the objects on it. Essentially, my question boils down to how to ask ...
1
vote
1answer
63 views
Python - Holding down key to move a sprite works, but only in one direction [closed]
I've been testing out movement for a fighting game that I'm creating in Python.
The problem is that when I try to move the sprite, it moves correctly to the left, but only ever works in that ...
4
votes
2answers
230 views
How to implement a mechanism to select language specific expression (python)?
On a game server, programmed in python, I want to be able to select language specific expression, according to the user's preference. Provided a 'name tag' and a 'language identifier' I want a ...
3
votes
1answer
3k views
Pygame for python 3.5?
I just got Python 3.5 from...
LINK: https://www.python.org/downloads/windows/
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 ...
1
vote
1answer
26 views
How can I change the anchor point of a Pyglet sprite?
while trying to make my game, I noticed that you can't change the anchor point of Sprites in pyglet.
I use some convoluted way(see bottom of the post) to draw my minimap(WIP) so that the rooms are ...
0
votes
1answer
208 views
Car Game: Engine and Gearbox calculations?
I am making a racing game inside of Blender Game Engine.
You can see the latest video here to get the impression of what type of game it is:
https://www.youtube.com/watch?v=0i3m-xXtnhc
What I want to ...
1
vote
0answers
29 views
Get original image size in Ren'py
I'm building a visual novel and in one scene, I want to have a couple of different images move from one position to another and change size as it moves.
My first position is called "doorway", my ...
0
votes
1answer
33 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 = ...
0
votes
0answers
13 views
Python & Pygame: How do I use this animated gif as background surface? [duplicate]
How would I go about putting an animated gif into my game in Pygame? I'm following along on the tutorial at inventwithpython (source) slidepuzzle.py
My code is very similar, as I'm just beginning how ...
1
vote
0answers
177 views
Unity3D LLAPI and Pyhton UDP communication
I need a Unity3D game on Android to receive UDP packages from a Python script running on a different device.
Using System.Net is not (yet) an option, as it is only supported on Android with a valid ...
0
votes
1answer
80 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 = ...
1
vote
2answers
133 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
49 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
95 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
64 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
18 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 = ...
0
votes
1answer
58 views
Pygame wall collision is acting very odd
I've been playing around with python for a while, but I only did basic functional programming.
Lately, I've been teaching myself about classes. I've been using pygame (instead of tk, because let's ...
0
votes
1answer
19 views
How do I update individual sprites within a spritegroup in pygame?
I have a for loop that takes values from a text file, and then creates and adds a bunch of sprites to a group platformlist_list. The for loop will continue until every line of the text file is read.
...
0
votes
2answers
65 views
Firing attack and take_damage events on entity attacking?
I have an Entity class with health, armor, and damage.
I want my entities to raise some kind of take_damage and attack events whenever they attack or take damage. Here's my current implementation:
...
0
votes
1answer
615 views
Locking the frame rate in pygame?
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 producing very desirable results. If I ...
1
vote
1answer
49 views
How to iterate a sprite group correctly in Pygame avoiding “maximum recursion depth exceeded”?
I'm making a game and I have almost finished it, but I'm usually finding the error RuntimeError: maximum recursion depth exceeded when I iterate a sprite group.
This is an example and the group is ...
0
votes
0answers
45 views
Pygame events work in Python2 but not Python3
When I run this code in Python2 it works (to read the keyboard), but in Python3 it doesn't. In Python3, I notice:
The game window opens, but it doesn't come to the front. The terminal window stays ...
0
votes
1answer
65 views
In Pygame, I can only display text once I stop updating and drawing, why?
At this moment, I can only display text once I stop updating and drawing sprites. In the code below (which is actually the game loop), you can see how if GAMEOVER == True (gameloop stops drawing), the ...
1
vote
0answers
56 views
Collision detection with PyGame
I have been making a 2d platformer using Python with PyGame. It has all be going good, but I have stumbled accross many problems with collision detection. Here they are:
You can't go through objects ...
0
votes
0answers
83 views
My sprites do not always respect collisions in Pygame
I have a Player sprite (40x40 pixels) and Tiles (20x20 pixels) which build the terrain. At the 4 edges there are 2 rows or columns (depends on vertical or horizontal) of wall tiles. Those are the ...
16
votes
2answers
3k views
Why does my sprite player move faster when I move the mouse?
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 using arrow keys. If I don't move the mouse, the sprite moves normally, ...
0
votes
1answer
17 views
Game Opens then Stops Responding Python
Sorry for the bad title, if you think of a better one please tell me.
So I was asked to make a button that says a line from a video game. I attempted to have the while loop add 1 to a variable every ...
-3
votes
1answer
169 views
Performance of programming languages and frameworks [closed]
I want to program an online 2D MMORPG with graphics like in this game. Since I develop in javascript and python mainly I chose python for my first games and the game library pygame which is pretty ...
0
votes
2answers
138 views
How to create old-school format music with small file sizes
My friend and I have been working on a project recently, and because we are hard coding everything (other than the graphics library, Pygame), the total size for our project is super small. I feel like ...
0
votes
1answer
58 views
I want to blit a standing man on pygame [closed]
I was making a game with pygame and python and I wanted to blit an image of a standing man and when a right key is pressed I want the man to run and when the right key is released I want the man to ...
1
vote
1answer
249 views
How do I convert an image into a tile map?
I am working on a game in Pygame/Python, and I'd like to turn an image into a map.
The idea is simple: Pixels in the image are colored by tile type. When the program loads the image, I want the color ...
0
votes
0answers
89 views
Python interpreter as in-game console
Say I have a game which has lots objects (NPCs, monsters, etc.), I want a console so I can change the variables of the objects (like changing HP for example), how could I embed python into my program, ...
3
votes
1answer
286 views
How should my game characters store their abilities/spells?
I'm new to game development and a bit confused about how to effectively store an object's access to certain spells/abilities.
The player and mob objects are all generated from the same class. ...
0
votes
2answers
72 views
How to detect a cursor inside a non-rectangle shape [duplicate]
How can I detect and do something if the cursor is inside a hexagonal shape? Is there any way other than detecting if it's in a rectangle area close to the shape of the hexagon? It would also have to ...
1
vote
0answers
32 views
Optimization of A* in Python [duplicate]
I am working on an IA (in Python) for small board game, and I need to do a lot of pathfinding per round in order to find the best move I can do (minmax implementation).
My problem is that even if the ...
0
votes
2answers
53 views
back-face (back-line) culling without winding order
In fooling around with my own 3D display engine I've been able to get a few modest features working, and I've come close with this latest one - line culling - but I fear in order to do it correctly ...
1
vote
0answers
101 views
Scripting language for high complex educational game [closed]
I'm at a stage of working at my C++ game that I need to implement a script language to allow the players to perform tasks inside the game's logic. I'm a sole programmer and thus it's entirely ...
0
votes
1answer
123 views
Pygame - Increase and decrease the image size
I'm creating a 2D game where the player shoots cannon balls.. To give the impression of movement, i want the cannon ball to increase size untill half of the path, and then decrease untill it reach the ...
3
votes
1answer
254 views
How can I tell if an object in a tile grid is surrounded?
I'm making a game which uses a 10x20 matrix to store the position of the objects.
I have a castle object, represented by a number in a matrix. It is randomly deployed in some cell of the matrix. I ...
0
votes
1answer
131 views
Rotating an image in Python
So I am making an "Asteroids" like game and I can principally get my sprites image to rotate but when I do, the image gets kinda torn apart. This is the method I am using for rotation. Any help would ...
1
vote
2answers
92 views
Playing a sound once pygame
I'm trying to play background music and the music keeps on starting. I tried to use music.busy, but I can't figure it out. I want it to check if sound/music is playing, then I want it to print "music ...
1
vote
2answers
175 views
Implementing monte-carlo tree search in a tile based game with units
I have this simple risk-like game I would like to develop an AI for. Players move their Units on the map and a simple fight resolution is done. There is a time constraint of 100ms for each round, the ...
0
votes
2answers
58 views
Getting a color value from a coord
My goal is to get a RGB value of a pixel based of off a X,Y coordinate.
I have been working on AIs for a small project attempting to make a bot that can pass through a maze. I want to get the pixel ...
0
votes
1answer
792 views
How do I make a sprite collide with walls in pygame?
I've been trying to create a collision detection between the player (Blue), and the walls (Green), but the player can just move through the walls. I made it so that every collision is printed in the ...