Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [python]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
40 views

Poor performance with camera zoom

I've created a Camera class that takes a source surface and draws it to a destination surface using the camera's parameters (position, zoom, size, etc.). The class ...
Rich. T.'s user avatar
0 votes
1 answer
23 views

Frustum Culling Not Utilizing Entire Bounding Sphere in OpenGL

My frustum culling is detecting an object as culled even though not the entire object's bounding sphere is out of the frustum yet. It's like it believes the bounding sphere's radius is smaller than it ...
Duck Duck's user avatar
0 votes
0 answers
52 views

Pyglet - How can I add a bloom postprocessing step to my scene?

I have a simple Pyglet scene below. I would like to apply a postprocessing step to add bloom to the scene. How can this be done using pyglet? I've tried looking through all the documentation for ...
Ray Larone's user avatar
0 votes
0 answers
37 views

How can I change checkers pieces to move only horizontally and vertically?

I am a beginner level programmer trying to learn Python. I could not figure out how to change the values so I can restrict the pieces of checkers from moving diagonally. I want them to be able to move ...
OneSec's user avatar
  • 1
0 votes
0 answers
32 views

How could I make the player rotate towards the cursor in pygame?

...
esnar moquete's user avatar
0 votes
0 answers
28 views

Collision glitches when player runs into side of a wall

I am coding a game for fun, and I am trying to implement collision; specifically, I want the player to be able to move to the side even when ramming into a wall diagonally (I had this problem before, ...
Tiimzee's user avatar
  • 133
1 vote
1 answer
55 views

Player not sliding on the side of a wall when two keys are pressed

I am making a game right now, and I am working on collision for different Rect walls (all of their data is stored in a list). It works great, except for one problem:...
Tiimzee's user avatar
  • 133
0 votes
0 answers
67 views

Building a game in Unity with Python OpenCV and MediaPipe

In Python, I have OpenCV and MediaPipe for the hand tracking controls for the Unity, and I want to build the game without opening the PyCharm to read the hand. Is there any way to build the project ...
Hans Balea's user avatar
0 votes
0 answers
50 views

Collision between a sprite and a rect in PyGame

I'm trying to make a simple platformer game, which has code to move the camera towards a player as they jump around. Now I have two classes: one for the player, and one for the platform. In the ...
Divyansh undley's user avatar
0 votes
0 answers
11 views

How offset is working in UE5.3 Rigging editor

How to get local offset of a control with Python in UE RigEditor? I’ve found a function to get global offset unreal.RigHierarchy.get_global_control_offset_transform ...
Dron4K's user avatar
  • 131
2 votes
2 answers
86 views

How to stop moving a sprite if the user is holding down the opposing moving key at the same time?

I am new to creating games with graphics, and I want to make a very hard game. I have the movement down, but it has a weird bug where it if the user presses down the opposing movement key (i.e. A is ...
Tiimzee's user avatar
  • 133
0 votes
0 answers
47 views

Full Unreal engine API support in Python?

I'm a newbie to the Unreal engine, and I've seen that there is very little documentation and examples of Python in the Unreal engine, so I'd like to ask if, leaving out the gameplay functionality, we ...
Haitao Xiao's user avatar
0 votes
0 answers
31 views

How to implement and understand Clipping

I am writing a 3D renderer from scratch in Python using PyGame and Numpy. I have the basics implemented, which are working well. I have noticed that when you get too near to objects, the objects ...
Matthew Haywood's user avatar
0 votes
2 answers
178 views

Infinite scrolling with mouse

I know we're able to scroll a background image hardcoded or using awsd keys(or arrows) if they're pressed. But what about scrolling it with mouse movement? So I have a piece of panoramic image as a ...
Intice's user avatar
  • 31
0 votes
1 answer
57 views

How does bullet physics filter 4+ contacts in GJK?

If the bullet GJK (Convex vs convex) collision algorithm has more than four penetrating points, then how is it filtering that down to the four it needs? What I've tried Staring at the code, but I get ...
Baer Ran's user avatar
0 votes
1 answer
229 views

Pygame code/file structure

I am currently working on a Pygame project and would like to seek your advice on best practices for organizing my code, particularly when it comes to creating additional scripts. I find myself ...
anathrax's user avatar
0 votes
1 answer
65 views

Sprite chasing a target using move_towards_ip does not move

I'm trying to get a turtle sprite to chase a falling algae sprite utilising Pygame's inbuilt functionality. I have spent many hours reviewing questions and answers and suspect I'm missing some ...
Lone's user avatar
  • 3
2 votes
1 answer
129 views

How do I mix an image with a specified color?

I have some images of static objects using per-pixel alpha (trees, rocks) for a background. In order to make them look a bit more natural, I want to create some kind of atmospheric fog, which means ...
Intice's user avatar
  • 31
0 votes
0 answers
42 views

Pygame showing surfaces at wrong coordinates with full screen

So I coded this line for the display surface: screen = pygame.display.set_mode((0, 0), pygame.FULLSCREEN|pygame.NOFRAME) But the thing is, when I place a rectangle ...
Le Guide Minecraft's user avatar
1 vote
1 answer
68 views

Selecting Tiles Correctly With Scroll

I would like to understand the process of selecting the correct tile from a scaled Surface when I have information about the number of tiles on the x and y axes, the length of the Surface, and also ...
anathrax's user avatar
0 votes
0 answers
284 views

PyOpenGL "Attempt to retrieve context when no valid context" - seems to be Linux specific?

I've been trying to learn PyOpenGL, so I'm still pretty clueless about what's going on. I've been following a video series. I couldn't get it to stop throwing "Attempt to retrieve context when no ...
brododragon's user avatar
1 vote
0 answers
167 views

Programmatically get FPS in Ursina

In Ursina, how can I programmatically obtain the current FPS count as number (like extracting it from the fps counter in the upper-right corner)? I need this for phyiscs calculations in Ursina. I have ...
EarthAndMoon's user avatar
0 votes
1 answer
165 views

Sprite Animation in Pygame Zero

How do I use a sprite sheet in pygame zero? The height of the images are 32, width is 25
Tokyn Blast's user avatar
0 votes
0 answers
62 views

Decrease size of hitboxes for a sprite in PixelPAD

I need to make the hitboxes of spikes smaller, so that it's not impossible for the player to get through. How do I do that?
CK Development's user avatar
0 votes
0 answers
18 views

How can I halt a check for intersections of sets in python when it discovers one member of the intersection?

How can I halt a check for intersections of sets in python when it discovers one member of the intersection? I want to do this so that when checking for collisions the moment an intersecting point is ...
Nato's user avatar
  • 9
0 votes
0 answers
77 views

pygame.error: video system not initialized

I don't know what's going on when I try to run pygame this error occures everytime no matter how much changes I have made. HERE'S THE CODE: ...
opidas's user avatar
  • 1
0 votes
0 answers
84 views

Make pygame rectangle disappear when ball collides

So I'm doing a brick breaker game using Pygame. I want that everytime the ball hits a brick, that brick disappears (idk how) Here's my code: ...
LGM's user avatar
  • 1
0 votes
0 answers
144 views

How to send camera feed to Python script in Unity?

I have an image recognition code in Python and I need the input image to come from the Webcam in Unity. I've seen the Python Scripting package and the method of using a websocket and take the app as ...
Nicolas Cordoba's user avatar
0 votes
0 answers
30 views

Why doesn't my image and text appear?

This is my code in question: ...
David Tan's user avatar
0 votes
0 answers
99 views

Unable to load texture from temporary directory

I'm developing a game in Ursina. Since my old question did not get any answers, I decided to extract the zip file to a temporary directory and read the assets from there, but not everything runs well. ...
EarthAndMoon's user avatar
0 votes
0 answers
223 views

Ursina not applying shader and light to entity

I'm making a terrain-based game in Ursina. I finished making the terrain and the texture, and all of them run well, but Ursina is having problems with the lights and the shaders. ...
EarthAndMoon's user avatar
0 votes
0 answers
84 views

How to load asset from zip file?

How can I load an asset (model, texture, etc.) from a .zip file in Python's Ursina module without extracting it? I tested this code: ...
EarthAndMoon's user avatar
0 votes
0 answers
206 views

WHY doesn't Python's Ursina module load textures from .mtl file?

Why doesn't the Ursina module directly load all textures from an obj's mtl file? Let's assume I have 4 files: test.py: ...
EarthAndMoon's user avatar
0 votes
0 answers
41 views

Perspective projection distortions

I'm building my own engine using python and pygame however my cube model is not able to be displayed correctly. This is my result after applying translation, scaling and projection matrices: ...
Zoler1337's user avatar
0 votes
1 answer
186 views

PyGame moves object in one direction but not in the opposite one

I'm having trouble with a PyGame animation I'm writting. I have a Ball class that defines an object that moves on the screen and bounces on the edges. I initialize ...
WinterPanda's user avatar
-1 votes
1 answer
421 views

"End of line expected" error preventing me from opening game

I wanted to open my game to check that everything is working properly, but whenever I try to open the project, it redirects me to the script instead. This is the message below: I'm sorry, but errors ...
Umi's user avatar
  • 11
0 votes
0 answers
62 views

Where are the docs and api reference for Python's Bullet-for-Ursina lib?

Where can I find the docs the and api reference for Bullet-for-Ursina? I already searched things similar to "Python Bullet for Ursina docs" but with no success.
EarthAndMoon's user avatar
0 votes
1 answer
138 views

Perspective projection not working as intended

I copied a perspective projection matrix from here (https://jsantell.com/3d-projection/) and applied it to my vertices. It looks ok but without depth. Rotation matrices also work. When I try to divide ...
Zoler1337's user avatar
1 vote
0 answers
80 views

Problems with RayCasting after fixing fisheye distortion

I am writing a pseudo-3D game in Python. After I tried to fix the fisheye problem, a new one appeared - if you stand close to the wall and look so that the wall is on the side, then the borders of the ...
kingley's user avatar
  • 11
0 votes
2 answers
521 views

Python ursina\mesh_importer.py: AttributeError: 'str' object has no attribute 'glob'

I'm making a weather simulator with Python's Ursina engine, but I cannot load models. The error stack: ...
EarthAndMoon's user avatar
0 votes
1 answer
174 views

Double trouble with Python's Ursina 3D engine

I'm making a weather simulator with Python's Ursina module, but the script crashes with two exceptions. Console output: ...
EarthAndMoon's user avatar
0 votes
0 answers
66 views

Why is my code giving an infinite while loop/crashing?

I have this large code that produces buttons that are meant to be clicked. ...
3141592654's user avatar
0 votes
1 answer
228 views

How to convert a Unity transform to Maya's coordinate system?

I created a level in Unity, and I want to place some of the level objects in Maya so I can create an animation based on these objects. I can import the model FBX with no problems into Maya, but if I ...
Panda Pajama's user avatar
  • 13.4k
0 votes
0 answers
76 views

Creating a flattened (panorama?) 2D view of a cubemap

I am trying to generate a 360 degree view of a scene by sampling a depth cubemap using spherical coordinates. x and y represent the horizontal, or azimuth, and elevation angles respectively and the ...
marcos's user avatar
  • 1
0 votes
0 answers
117 views

How to extend a VBO in OpenGL and keep its data?

I'm making a game with infinite, blocky procedurally generated worlds in python, with PyOpenGL. I figured out that allocating all the VBO space at once causes a lot of lag. To fix this, I am ...
N3RDIUM's user avatar
  • 53
0 votes
1 answer
48 views

Why doesn't the fire appear when moving code to a function?

This is my code: ...
David Tan's user avatar
0 votes
2 answers
127 views

How do I get my character to move?

This is my code: ...
David Tan's user avatar
1 vote
0 answers
107 views

Pyglet TextEntry not Working

I have been trying to make a simple game, and have recently been trying to work on a menu system for it. I am trying to insert a TextEntry box using the examples they have provided themselves. I have ...
thor625's user avatar
  • 25
0 votes
1 answer
136 views

Pyglet.gl has no attribute glTranslatef

I have just started working with pyglet trying to make a simple game as a hobby. However, I have run into an issue. I am working with this demo: https://github.com/pyglet/pyglet/blob/pyglet-1.5-...
thor625's user avatar
  • 25
-2 votes
1 answer
405 views

How to randomize all the colors to different colors every time the snake eats and grows?

I'm new to python and am making snake for a project/ I'm not sure how to randomize all the colors to different colors every time the snake eats and grows. I've looked up multiple things and nothing ...
c0der's user avatar
  • 1

1
2 3 4 5
13