Skip to main content

Questions tagged [python]

Python is a dynamically and strongly typed programming language that encourages readability.

Filter by
Sorted by
Tagged with
3 votes
2 answers
342 views

I thought a fun way for my son and I to learn and improve our python programming skills respectively is to digitize one of his (and my and my mom's when we were his age) favorite board games, "...
Nick's user avatar
  • 33
1 vote
0 answers
172 views

For a project I've been working on, I need to know how to draw to a surface/texture/whatever, that could be used as a texture for binding to a vertex list. I'm fairly new to python/pyglet, and couldn'...
user159084's user avatar
2 votes
0 answers
177 views

I'm working on a simple script to be used as a personal code skeleton for pygame projects (making this primarily for practice with Python, PyGame, and game design) but I'm running into an issue with ...
Seth Lamancusa's user avatar
0 votes
1 answer
782 views

I've been struggling a lot to learn how to use vectors in programming. Now I've successfully made my own vector class but I still can't use vectors for movement. This is my class : ...
Salem's user avatar
  • 226
0 votes
0 answers
161 views

this my code ...
Ok.'s user avatar
  • 1
-1 votes
1 answer
677 views

Hi everyone I am trying to make a Mahjong Solitaire game using pygame. I want to create a list of objects (the tiles of the game) using a for loop, but I can't manage to set a different type (the ...
Matteo Scalas's user avatar
0 votes
1 answer
187 views

I am creating a game of checkers using the but am struggling to find a good internal representation for the game. My initial thoughts were to store the game board in a 2d list, with 0=empty, 1=always ...
J French's user avatar
-2 votes
1 answer
55 views

It was working before, then I added the enemy rectangle and it has stopped working. ...
Monty 1's user avatar
1 vote
0 answers
130 views

I am making a 2d multiplayer game for Android, targeted to run on every device. How do I calculate the common position of an asset, independent of screen size? What size map should I assume is a ...
Abhay Kumar's user avatar
0 votes
0 answers
258 views

I want to open an .obj file using retcave. Here is the code I am using: ...
Asiya Naqvi's user avatar
0 votes
0 answers
242 views

I was wondering if anyone had any pointers in integrating gpt-2 into unity. I've got quite a bit of experience with python, but less with unity. What I'm trying to do is use a pretrained gpt2 model in ...
Dpythonrobot's user avatar
-1 votes
1 answer
3k views

I've been making my own games in many different languages (mainly Scratch, Python 3 with Pygame, and JavaScript), but, so far, none of them have been ported to the Nintendo Switch. How can I do this?
Zachary Rude's user avatar
0 votes
0 answers
1k views

Me and a team of junior developers are making a role playing game. We would like to make something similar to https://bunk.town/ I have only made a Tetris clone which doesn't require much knowledge ...
Lead Vaxeral's user avatar
0 votes
1 answer
824 views

So, I am making Flappy Bird and when the player dies I have the spacebar assigned to reset the game. However, it's not working and I truly have no idea why (after like 3 hours of going through ...
dotmashrc's user avatar
  • 119
0 votes
1 answer
1k views

Consider the following code: ...
Erithax's user avatar
1 vote
1 answer
228 views

I am making a card game and I am having issues implementing "effects" and effects that are continuous. How can I get effects to activate at the right times, before and after an attack does ...
pillowism's user avatar
0 votes
0 answers
220 views

2 players works fine but I can't debug the minimax algorithm, it just keeps going.. sorry that the code is messy ...
Jerpen80's user avatar
0 votes
1 answer
174 views

Until now, I know 2 bullets' algorithms/configurations : (I mean 2 ways of logically creating a bullet class) Make a bullet class and create only one instance from it that represents the bullet. The ...
Salem's user avatar
  • 226
0 votes
1 answer
131 views

Bit new to python. I'm making a game where you click on a strawberry, then it reappears in a new location, and so on and so forth. But you see, every time the player misclicks, they lose Score equal ...
pythonnoob's user avatar
0 votes
1 answer
479 views

I am working one the movement for a tactical turn-based pygame. I'm stumped as to how to get a selected object to move one tile at a time up to it's max movement to the mouse's pos. Right now this is ...
AnimalChubs's user avatar
1 vote
2 answers
7k views

I am making a game in Pygame and I want it so every time the sprite jumps it rotates mid-air and lands on its side. A lot like Geometry Dash jumping if you have ever played that. I have some code but ...
Pixeled's user avatar
  • 111
0 votes
1 answer
367 views

I am trying to make a top-down tank shooter game in Python and pygame, but I can't get the tank movement right. My objective is to make it move forward in the direction it is pointing in which would ...
MicroJet's user avatar
0 votes
0 answers
137 views

So, I've been trying to load a tmx file through pytmx But when it loads the file, it only loads a black image with the same resolution as the tmx file. ...
emipy's user avatar
  • 1
0 votes
1 answer
119 views

I found this on the About page on the official Pygame website: Truly portable. Supports Linux (pygame comes with most main stream linux distributions), Windows (95, 98, ME, 2000, XP, Vista, 64-bit ...
gavinskycastle's user avatar
-1 votes
1 answer
74 views

In my pygame dungeon rpg when my player collides with a wall at the top or the bottom of its rect and I move the player in either x-direction, the player gets slingshotted off the screen. Using print ...
lines's user avatar
  • 1
1 vote
2 answers
756 views

I made a sprite (hitmarker) to appear middle of your mouse when you click on a sprite (egg), but the hitmarker sprite appears at the right bottom of your mouse like this: however, I wanna make it ...
Zgn's user avatar
  • 11
-1 votes
1 answer
1k views

In my code, I wanted to use the spritecollides method but I got the following error message: Traceback (most recent call last): File "/Users/lanik2009/Documents/pygame testing.py", line 76, ...
Lanik's user avatar
  • 1
1 vote
1 answer
1k views

in pygame, we use pygame.time.set_timer() to repeatedly create an event. This function takes 2 arguments : the event type and the delay time after which the event ...
Salem's user avatar
  • 226
0 votes
1 answer
418 views

I'm having an issue that causes the window bar to appear above the screen when jumping between full-screen and windowed mode. Did some googling on the issue and it turns out it's actually a pygame bug,...
JustCodingAgain's user avatar
0 votes
1 answer
203 views

i have made this bullet class but i have a problem with the firerate. Sometimes i'm not able to shoot even when the little delay (700ms) between the two shots has ended. I guess it's due to the ...
Salem's user avatar
  • 226
0 votes
1 answer
197 views

I want to create a game in Unity or UE4 which allows the user to write scripts in Python and run them mainly to control the AI. I will have to find a way to enable runtime script execution first. ...
spatial's user avatar
  • 101
0 votes
1 answer
1k views

I'm working on my first game, and I decided to add some trees that twinkle to the game. For some reason when the image is blitted to the screen using pygames blit ...
JustCodingAgain's user avatar
0 votes
0 answers
978 views

I am making a 3d renderer with python and so far am sorting the triangles which I want to replace with a z-depth buffer. The thing is, I don't know how to make a z-depth buffer in pygame. I still want ...
Michael Iakimenko's user avatar
0 votes
0 answers
48 views

I have blitted 4 zombies to the screen in pygame. First, the zombies will wander in a specific region (let us say a 10 x 10 area). And when the player enters any one of the zombie's areas, the zombie ...
Lokes's user avatar
  • 1
1 vote
1 answer
248 views

So I basically want to load another map once the player collides with a object, specifically a "Portal" in my game. Which is really making the player move onto other levels. I don't want to ...
jinna's user avatar
  • 11
1 vote
1 answer
274 views

I'm making a game sprite, with animations for transitioning to different states, such as idle, sleeping, etc. I'm wondering what the most efficient way to play the animations is. As of now, I have a ...
Naren's user avatar
  • 13
1 vote
2 answers
4k views

I'm making a game with Python, using Pygame. I want to publish my game on itch.io so that it's playable in the browser. Is there a way to do this? If so, how?
Devin Little's user avatar
0 votes
0 answers
173 views

I thought about making something with ApeOut graphics long before it came out and its release motivated me to try - I'm having tons of fun but I stumbled upon a pickle. I can imagine storing polygons ...
cprn's user avatar
  • 254
1 vote
1 answer
333 views

I’ve written a few games in Xcode before and would like to turn one into the simplest possible 2D top-down RPG multiplayer game. Essentially just needing movements around a big tiled map (I love ...
Donny7's user avatar
  • 11
0 votes
0 answers
298 views

I didn't see any other questions like this that had an answer so I thought I'd ask in hopes this helps someone else too. I have a game I'm in the beginning stages of working on, and I've gotten to the ...
justthom8's user avatar
  • 123
0 votes
1 answer
122 views

I'm working on a game where I want the player to appear on the other side of the screen when they get to the edge of the screen, essentially mimicking the background moving. When the player gets to ...
justthom8's user avatar
  • 123
0 votes
0 answers
86 views

I have some user data downloaded using the Steam API (I am following the approach described here) and I need to find the format for each entry of the CSV file I generated (available here). Using ...
user avatar
1 vote
1 answer
510 views

I am experimenting with procedural techniques to generate planetary terrain. I have close to zero knowledge so I started with something simple, using perlin noise and domain distortion. My goal is to ...
Gonstasp's user avatar
  • 111
0 votes
1 answer
131 views

Basically, I have a NumPy array of rectangles that store their colour and position. I want to be able to compare my mouse position and clicked on the rectangle's position and get the index or the ...
Armanii Criston's user avatar
0 votes
1 answer
500 views

I have got a json file and I am trying to load the single sprites from that file but I gives this error after a few loops and also the animation is not smooth(gets stuck) error: ...
LionCatDev Studio's user avatar
0 votes
2 answers
948 views

I'm attempting to create a boundary around the window to stop the sprites of my game from escaping but it doesn't seem to be work, when they hit the area where its supposed to stop them it instead ...
Flat_Pancake's user avatar
1 vote
1 answer
673 views

I would like to structure my gui into different panels. so to help keep my code managable i thought it might be a good idea to have a main panel. with its own manager and then a secondary panel with ...
bertibott 's user avatar
1 vote
1 answer
147 views

I tried to display a player image in a 800x600 window using PyGame but when I try it, the window just gets stuck (immovable with mouse drag, minimize,maximize and close button is stuck and not ...
user avatar
0 votes
0 answers
352 views

So I've made an game which just has a script named "TrainYourBrain.py". I wanted to make an exe of it but I failed. It just gives the error Failed to execute script TrainYourBrain My game ...
CopyrightC's user avatar
1 vote
2 answers
4k views

I am very new to Python I started to make a pong game, but can't get it to let me hold down the buttons for the paddle to move. I'm using the builtin turtle module, not Pygame. ...
Heenoo 's user avatar

1 2
3
4 5
13