Questions tagged [python]

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

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

How to use Python to send data back and forth between PS5 or Xbox Series X|S controller and PC [closed]

We are trying to use Python script(s) to Perform repetitive and automated animations / moves / actions in console videogames Record and send specific data from the controller to PC (e.g. success rate ...
0
votes
0answers
11 views

I am coding a arcade game for my class [closed]

I am trying to figure out how to do a melee attack event listener button in python for a arcade machine. I need some help trying to figure it out Can Someone please help me?
1
vote
1answer
26 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
12 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
22 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
35 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
37 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
36 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
24 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
25 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 ...
1
vote
1answer
57 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 ...
0
votes
1answer
38 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 ...
1
vote
1answer
111 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
29 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
43 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
26 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
47 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
82 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
18 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
19 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
19 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
89 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 ...
0
votes
1answer
30 views

How to get object or its index from mouse coordinates? [closed]

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

Animating from json file in pygame?

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

How can I create a boundary so the sprites don't go off screen?

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

Using multiple pygame_gui managers

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

The gameloop is stucking the window

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

Failed to execute script {pygame.exe}

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

How to load a new map when player reaches a certain point using if tile_object.name == 'door" (pygame)

I have been working on creating a 2d game, and I am now at the point where I want the character to be able to interact with his environment. I have created a few different obstacles such as a house, a ...
0
votes
1answer
29 views

python game hold down keybind?

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 paddel to move, im using the turtle not pygame ...
0
votes
0answers
74 views

How do I update this code to hit a moving target from a moving shooter?

I am working on a game where one spaceship("Origin") can shoot a dumb projectile("Projectile") at another spaceship("Target"). Since the target is moving we will have to ...
0
votes
0answers
604 views

Using pygame with multiple threads

I have decided to try out pygame. I created a class that is supposed to handle all the GUI and game related stuff. My idea is that I would have two seperate threads. One to handle the GUI and one to ...
0
votes
0answers
23 views

How can the game graphics be stabilised when after each frame hundreds of calculations are taking place? [duplicate]

I am building a very basic 2D game purely using pygame library in Python 3x. The "game object" is blit(ed) onto the screen using a loop and after each pass, there are calculations taking ...
0
votes
1answer
577 views

OpenGL convert mouse position to world coordinates without gluUnproject in Python?

EDIT: I changed the bottom left to -1,-1 and the top right to 1,1, and while I can draw objects within this range, I cannot map the mouse x,y to the world space. I have been trying to learn OpenGL and ...
0
votes
0answers
104 views

How to copy morphs from one SkeletalMesh to another in UE4?

I would like to enable modders to copy morphs from one SkeletalMesh to another. I wrote simple Python script to do that. The inspiration came from here. ...
1
vote
1answer
88 views

delta_time with discrete movement

I have a basic snake game movement system with Pygame: ...
0
votes
0answers
32 views

Joining lines together into a single line

I’ve been working on a GDscript to draw isolines (contours). I’m using the Meandering Triangles algorithm from https://blog.bruce-hill.com/meandering-triangles, and it works pretty well! The problem ...
0
votes
0answers
20 views

How to fix edge scrolling on a 2d scrolling camera?

Afternoon all, I just cannot get this to work properly and I'd really appreciate any help. I have a camera that follows the player around a 2d tile based map. However, I want the camera to move only ...
0
votes
0answers
33 views

Pygame - RPG Battle-Style Animation and movement when not controlled by player

Examples: https://www.youtube.com/watch?v=C2cOiFntLY4 https://www.youtube.com/watch?v=iHl1YFkeR78 I am making a small little RPG based on a text-adventure game that I made. This RPG involves a battle ...
1
vote
1answer
130 views

PyBullet & OpenGL - Rotations are reversed in OpenGL [closed]

Project description: I am writing a basic game engine to help with my PhD topic on multi-agent learning. I am using PyBullet as the backend physics engine and OpenGL for visual display. I have OpenGL ...
1
vote
1answer
253 views

How to create a 2D tile-map in python ASCII style

Still learning about python programming and I wanted to create a little map like below but the thing is I know a for loop will draw down not draw across. However, I want to change the size of the area ...
0
votes
0answers
6 views

exporting blender explosion modifier [duplicate]

does anyone know how to export an explosion modifier in blender and use it in panda3d? I have tried a lot of settings but not sure how to do it, all I want to do is see a mesh explosion in panda3d ...
0
votes
0answers
61 views

creating model mesh and face explosions on Panda3d and Blender

I'm quite new to Panda3d and Python (1 year) and I've been trying for longer than 4 months to find out how to create a simple mesh explosion in Panda3d. I've created lots of different explosions using ...
2
votes
1answer
365 views

Non-rectangular collision detection in Python and Pygame

I am programming a ray tracer in python, and I have gotten as far as making a character that can move across a 2d plane and change direction of movement when needed. The problem is this: I want to be ...
1
vote
1answer
95 views

How do I draw my particles when an enemy is killed?

I have enemies that move left and right. I was wonder how I could make my particles show up when the enemy is killed? Here is my particle class ...
1
vote
2answers
43 views

Rotating Cannon's Mouth Toward Player

I am trying to make my cannon mouth rotate towards player, but the rotation is messed up and up I don't know how to fix it. ...
1
vote
1answer
192 views

Implementing melee combat in pygame?

I've gone about 2 ways for implementing melee attacks however, bboth have major flaws, hoping someone has a simpler answer. Method 1: Creating a "projectile" that's using an image, then ...
1
vote
1answer
86 views

Problem With Enemy Bullets Attacking The Player Pygame

I am trying to make my enemy bullets attack the player but it only attack its x and y how could I make it curve instead of zigzagging VIDEO the bullets only attack the y axis and it wont curve or go ...
-1
votes
1answer
157 views

python sockets: receive data only when data is available?

I am writing an update to a game I have written in python, and I am currently adding server support. I can't show you the main code (for the client), as it is hundreds of lines long. However, what I ...

1
2 3 4 5
11