Questions tagged [python]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
8 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
15 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
10 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
62 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
20 views

How to get object or its index from mouse coordinates?

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
39 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
37 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 ...
0
votes
0answers
28 views

Pickup and drop inventory system in Python

I need help creating an interactive inventory where there are 3-4 items present on ground in a certain amount, for example, number of swords on ground = 4. I want it to be interactive while keeping it ...
1
vote
1answer
43 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
39 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
64 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
28 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
16 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
55 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
83 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
159 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
47 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
53 views

delta_time with discrete movement

I have a basic snake game movement system with Pygame: ...
0
votes
0answers
28 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
19 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
27 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
81 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
114 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
38 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
157 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 ...
2
votes
1answer
74 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
113 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
73 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
37 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 ...
0
votes
2answers
86 views

How to make planets “stay together” on collision

I working on a 2D planetary orbit simulator and I've encountered a problem regarding the collision of planets. Currently, here is what I have ...
0
votes
1answer
36 views

EndScreen Not Loading My Best Score And Current Score How To Fix?

I am trying to make my endscreen save last score and current score but it just appears as 0 for both everytime I die event he I picked up the coins image so basically it isnt saving my coins I had and ...
0
votes
1answer
87 views

Pygame End Screen Problem How To Fix?

Video as you can see there I am trying to make my end screen restart my game but whats happening is that its not restarting my game its just loading the same thing when I die >> how could I make it so ...
0
votes
0answers
49 views

Enemies Bullet Shooting At Player Problem How To Fix?

I am trying to make my enemies shoot at my player rect where ever the position the player is and when it collides with the rect it should remove the -1 health ***my problem is that when the enemy ...
0
votes
0answers
48 views

Problem WIth Enemies Bullets PyGame

I am trying to make my enemy shoot my player but for some reason the bullets arent showing nor they are shooting at the player I don't even know why, I even draw the bullets on my window VIDEO ...
0
votes
0answers
38 views

Pygame Tiled Map Object layer collision

I'm using pygame to make a top down shooter I've placed my tiles and object layers using Tiled Map Editor. My player and mobs collide with their spawn locations (object layer) is anyone able to help? ...
0
votes
1answer
89 views

Pygame Scrolling Bug With Enemys

I have a problem with my enemy where when my player scrolls left the enemy scrolls with the player is there anyway to fix this even Video my full code is below its to long to fit here though what I ...
0
votes
0answers
27 views

How to call Python script in Unreal Blueprint and pass argument to it in Blueprint?

How to call Python script in Unreal Blueprint and pass argument to it in Blueprint? Would appreciate any advice.
-1
votes
1answer
88 views

How do I debug OpenGL apps written in python?

How do I debug OpenGL apps written in python? I tried but I was unable to use standard tools like nvidia nsight or glsl-debugger or renderDoc on python code.
0
votes
0answers
33 views

Rock paper scissor Lizard spock

I have been trying to code R-P-S-L-SP game on my computer but it has another argument which makes things hard. I need to code the game inside of a maze! My problems starts where to use my classes and ...
0
votes
1answer
41 views

Player won't move correctly due to gravity force pushing him into the ground

I am making a tilemap platformer with pygame ad I defined the X and Y movement for the player and also a Y force that represents the gravity force to make it jump correctly. However, when my player ...
0
votes
1answer
35 views

Why doesn't my Pygame game scroll properly?

When I am clicking the arrow keys, in order to scroll my ground and my lucky block, I cant just press the key and it keeps on going scroll. So I need to press the key every second to get a kinda ...
0
votes
1answer
63 views

How do I make my level scroll side-to-side as the player moves?

I am trying to figure out how can I make a side-scrolling view in Pygame. If I am moving right or left, I want the portion of the level shown on-screen to shift to follow the player character. Here ...
0
votes
1answer
73 views

Why does collision only work sometimes when there are multiple objects in the game?

when i was making a pygame in python for the first time i kinda have a problem where sometimes the player and the object would touch and the game would not close as intended i dint seem to find the ...
0
votes
1answer
37 views

How to map texture across whole face?

I'm trying to map a texture to a square face in OpenGL 3.2, but the texture gets tiled in the upper right corner. I've tried changing the uv coordinates, vertices and shaders, but nothing seems to ...
0
votes
0answers
21 views

the identifier “icon” is not declared in the current scope [duplicate]

(Sorry if i have spelling mistakes i am Bulgarian) I have the problem that my "icon" isn't declared in the current scope. i am trying to add an object (body, collisionshape, and a sprite) this is ...
-2
votes
1answer
46 views

how do i make it so you can hold down a key to keep moving

so I am trying to make my first working game and it is not working. There is no error message, it just does nothing. I want the box guy to move right or left when you hold down left or right arrow key,...
0
votes
1answer
66 views

How to add multiple floors to a map in a text-based game?

I decided to learn how to make games during this quarantine. I am reading Mission Python, a book that teaches how to make games using python and pygame. I'm halfway through it, but the game only has ...

1
2 3 4 5
11