Questions tagged [python]

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

Filter by
Sorted by
Tagged with
-1
votes
0answers
28 views

Optimizing Tetris in Python

While working on a Tetris clone in Python using the Tkinter library, I have realized that my code is slow and that it lags on school Chromebooks. If anyone can speed this up significantly, this would ...
0
votes
0answers
29 views

How to make a multiplayer game for multiple screen sizes?

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 ...
0
votes
0answers
42 views

python open .obj file that doesn't have normal information stored

I want to open an .obj file using retcave. Here is the code I am using: ...
0
votes
0answers
30 views

Integrating gpt2 into unity

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 ...
-2
votes
1answer
78 views

How do I port a game made with Scratch, Pygame, or JavaScript to the Switch?

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?
0
votes
0answers
48 views

Entity Component System in Python

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 ...
0
votes
0answers
35 views

Implementing growth in Snake?

I'm new at this, so I thought I'd start simple. Snake. I started with pygame, just looking some things up, and I've now got movement, random fruit generation, and a score counter. ...
-1
votes
0answers
22 views

implementation of a b-spline curve n points

hi i'm trying to implement the n points spline curve, but it seems like it requires some calculus knowledge. Unfortunately I did not follow the calculation of high school. I would like a function that ...
0
votes
0answers
26 views

How to draw player from the bottom up [pygame]

so I have this basic game I made with pygame, in the game I have this player sprite: which is 16x28, problem is: all other sprites in the game are 16x16, so I want the player's hitbox to be 16x16 as ...
0
votes
0answers
30 views

effect and ability activation in state system?

First time that i am making a text based card game, the main code here is starting to feel a bit clunky.This is a turn-based/phase based system where an effect/ability activates in a specific state/...
0
votes
1answer
22 views

How to blit a surface onto an already blitted surface in Pygame?

Consider the following code: ...
1
vote
1answer
59 views

How do I create an event trigger system for a Discord bot?

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 ...
0
votes
0answers
26 views

Minimax algorithm seems stuck in infinite loop, please help!

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

Recycling bullets versus spawning them on demand

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 ...
-1
votes
0answers
25 views

Why isn't my player in its pygame rect?

I am making a game in pygame and my player is supposed to be in its rect but it's not. Here is my code, What is wrong and how do I fix it? ...
0
votes
0answers
24 views

3D to 2D transformations with numpy

I am trying to create my own game in the python terminal, but I just can't find something I can use in python. I found something on https://www.gamedev.net/forums/topic/59091-projection-matrix-amp-3d-...
0
votes
1answer
62 views

How to make a number show how much the player will lose

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 ...
0
votes
1answer
74 views

Turn-based grid movement - each click of the clock you want to move the player

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 ...
0
votes
1answer
110 views

How do you rotate a sprite in pygame?

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 ...
0
votes
0answers
24 views

How I can get my pong ball collide on the paddle and bounce back?

Here is my code so far: ...
1
vote
1answer
69 views

Top-Down Tank Physics with Pygame

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 ...
0
votes
0answers
15 views

Pytmx loads no tiles or textures, it seems

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. ...
0
votes
0answers
43 views

How to remove a sprite from a group?

I am trying to make a chess game with Pygame, but am unable to remove the chess piece when it is captured. Stack Overflow already has a question on this here. But this code doesn't seem to work. When ...
0
votes
0answers
27 views

Pygame tile_size scalling to fullscreen/resizable window

I'm a newbie and I ran out of videos to watch on how to scale your tiles/sprites to fullscreen/resizable window on Python using Pygame. When I try to resize the window it looks like this: When I'm in ...
0
votes
1answer
35 views

"contains support" for Dreamcast/Atari/etc, but "not officially supported"?

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 ...
-1
votes
1answer
47 views

How to stop player from slingshotting across my game window

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 ...
0
votes
0answers
42 views

Python Opengl Procedural Terrain Rendering

I am rendering procedural terrain in Python using OpenGL. Once generated, data for each terrain tile is stored in lists. However currently I am only getting around 25fps despite rendering only around ...
0
votes
1answer
63 views

How can i make a sprite appear middle of your cursor? Pygame

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 ...
-1
votes
1answer
108 views

why doesn't spritecollide method work?

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, ...
1
vote
1answer
160 views

How to display the counter in pygame.time.set_timer?

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 ...
0
votes
1answer
35 views

Full screen to windowed screen workaround causing segmentation fault in pygame

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,...
0
votes
1answer
34 views

Pygame bullet firerate not working sometimes

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 ...
0
votes
1answer
54 views

Would creating a player scriptable game using Unreal Engine or Unity violate their license agreement?

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. ...
0
votes
1answer
93 views

Image color being changed when pygame blitting to screen

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 ...
0
votes
0answers
64 views

How to make a z-depth buffer with pygame?

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 ...
0
votes
0answers
26 views

How would you have a range of movement within a class in pygame?

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 ...
0
votes
0answers
86 views

How can I upload a pygame that I made on a website? [duplicate]

I'm a beginner programmer and I want to know how can you upload your pygame on websites like coolmathgames or any game websites, do you upload your code after you get a deal with them? do you save it ...
2
votes
1answer
70 views

player teleporting into other levels

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 ...
1
vote
1answer
42 views

Efficient sprite animation display methods?

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 ...
2
votes
1answer
285 views

How can I publish a Python game on itch.io as html?

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?
0
votes
0answers
39 views

Where to store polygons and polygon animation?

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 ...
0
votes
0answers
84 views

How can I change the background color of the image?

I'm trying to change my background image color, but somehow it doesn't work. I have provided my code below and hope you will be able to tell me how I should do this, and why my code didn't work. ...
0
votes
0answers
29 views

Fail to install ML-Agents (python packages)

I have been trying for hours to install pytorch and mlagents with cmd, however I am getting pretty much the same error for each package I'm trying to install - ERROR: Could not find a version that ...
0
votes
0answers
81 views

How to make a sprite face the player sprite (pygame 2d)

Basically I have a sprite and I want its front/face to face the player sprite. All the sprites are rectangles/squares and use .get_rect(). I have a base class for ...
1
vote
1answer
99 views

Networking to make a single player RPG into multiplayer

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 ...
0
votes
0answers
25 views

Sprite walk animation blurring when sprite image moves too quickly

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 ...
0
votes
1answer
21 views

Player not moving camera to the other side of the screen when hitting the screen edge

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 ...
0
votes
0answers
23 views

Find format of data from Steam API using Python

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 ...
0
votes
0answers
14 views

PYGAME - Sprite movement seize to function when entire X and Y span is reviewed

I've created an sprite class that has a detection radius checking if the player enters the zone. If yes, the sprite moves towards the player. It works perfectly fine when the sprite checks for three ...
1
vote
1answer
111 views

Domain distortion on a spherical texture (planetary surface)

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 ...

1
2 3 4 5
11