Questions tagged [python]
Python is a dynamically and strongly typed programming language that encourages readability.
635 questions
0
votes
0
answers
61
views
Applying greyscale shading to objects in a Python 3D renderer
I need help with how to apply greyscale shading to objects in a 3D renderer I made in Python. The code is pasted below:
...
0
votes
0
answers
21
views
How do I make smooth 2 way shooting in pygame? [duplicate]
I have been trying many thing to make my code work to make a player shoot a small box both ways (left and right) without being able to change the direction of the projectile mid shot.
I would be very ...
0
votes
1
answer
146
views
Can I Create a Camera System in Pygame Without Using Classes?
I am working on a basic side scroller platformer in Pygame. I want to add a camera system that tracks the camera and scrolls the world and I want to make the camera systems without using Classes. ...
0
votes
0
answers
60
views
How to use sensors and ray casting for collision detection in Pygame (using a custom Mask/sensor class)?
I am making a Sonic game in Pygame and I have recently gotten my hands on a Python class that uses pygame.rect and pygame.mask in unison to create sensors that can be used to accurately detect the ...
0
votes
1
answer
203
views
Score counter in Python game assigning points to both players
I am trying to learn to code a simple game with 2 players shooting at horizontal-moving enemies from the bottom of the screen.
Everything is working fine except for this:
When player 1 hits enemy ...
0
votes
0
answers
52
views
Video editing/editor in Godot or use Godot animations for video editing in Blender Video Editor or elsewhere
I found it very nice and easy to make animations in Godot and it allows you to generate animations using programming, which is marvellous. You can animate the movement of a text with a complex ...
0
votes
0
answers
59
views
Raspberry Pi Live data to Unity through Ethernet connection
I have a gyroscope storing data on a Raspberry Pi 4 (The Client) and I need to send this data to Unity C# (The Server) so I can use a gyroscope to control position data.
I have two separate devices I ...
0
votes
1
answer
98
views
How to get X and Y pixels of a Image in SDL2?
I am trying to create a Voxel Space Engine In SDL2 C++. However the tutorial I am following reads the X and Y pixels of the heightmap image. I can't find a way to do this.
I am following this tutorial:...
1
vote
1
answer
117
views
Connecting Isolated Paths in Randomly Generated Maps
I am new to game development, I previously created games using tiledmap editor and pygame, but manually creating map was real pain, so i begun to look how can i procedurally generate map, after ...
0
votes
0
answers
66
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 ...
1
vote
1
answer
88
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:...
0
votes
0
answers
75
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 ...
0
votes
2
answers
322
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 ...
0
votes
1
answer
696
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 ...
2
votes
1
answer
318
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 ...
1
vote
0
answers
394
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 ...
0
votes
0
answers
133
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:
...
0
votes
1
answer
353
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 ...
0
votes
1
answer
236
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 ...
0
votes
2
answers
875
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:
...
0
votes
1
answer
450
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 ...
0
votes
1
answer
90
views
Why doesn't the fire appear when moving code to a function?
This is my code:
...
1
vote
1
answer
259
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 ...
-2
votes
1
answer
764
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 ...
0
votes
1
answer
911
views
How to get better performance with pygame?
I'm not a gamedev, I'm a API/Cloud dev, performance has never been an issue for me since most of the time we are limited by network calls.
I've been playing with that for the past 2 days, I wanted to ...