Questions tagged [python]

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

90 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
0answers
145 views

Scoreboard setdisplay list shows correctly per char. Can i make my sidebar show correctly per char as well?

So I've been writing a script over the last little while in Python that interacts with the Minecraft console. I'm basically trying to make a scoreboard based currency system that is world independent ...
5
votes
0answers
2k views

Unity3D LLAPI and Pyhton UDP communication

I need a Unity3D game on Android to receive UDP packages from a Python script running on a different device. Using System.Net is not (yet) an option, as it is only supported on Android with a valid ...
4
votes
0answers
282 views

Python interpreter as in-game console

Say I have a game which has lots objects (NPCs, monsters, etc.), I want a console so I can change the variables of the objects (like changing HP for example), how could I embed python into my program, ...
3
votes
0answers
152 views

How to convert screen to world coordinates while using gluLookAt / gluPerspective or similar matrix transforms?

I am just starting an adventure in looking under the hood of graphics for a game project I've been working on for a while, and I could use some guidance. I am using Python/Kivy (though that is not ...
3
votes
0answers
818 views

IronPython with Python in Unity: How should I manage dependencies Python-side?

I am currently trying to get Python working in Unity, and I was wondering how would I manage dependencies on the Python end. For example, say I have a Python script with the following dependencies: <...
3
votes
1answer
2k views

How can I move a vehicle using speed and steering angle?

I want to drive a vehicle in x and y coordinate area with range from (0,0) to (6000,5000). I am using Visual Components (using Python API). On input I have speed data and steering angle of wheels ...
3
votes
1answer
411 views

How do I make mask work

I have been trying to make a game, but mask collision doesn't seem to work. Here is my code: ...
3
votes
0answers
253 views

Batch z-ordering problem in Cocos2d (Python)

I have a weird problem with my hexmap drawing code. My code uses "squished" hexagons to achieve a pseudo-isometric view. Because of that, the order of drawing them on screen matters a lot. ...
3
votes
0answers
69 views

SGC toolkit for PyGame and resizeable windows

Can I create a resizeable main window if I use the SGC GUI toolkit for PyGame? If so, how?
2
votes
0answers
211 views

How can I use iteration to lead targets?

In my 2D game, I have stationary AI turrets firing constant speed bullets at moving targets. So far I have used a quadratic solver technique to calculate where the turret should aim in advance of the ...
2
votes
1answer
1k views

How should I implement a dialogue box in Pygame?

I'm working on a small RPG with Pygame, using Python 3.5.1. I've spent a week trying to find a decent tutorial or example for a dialogue box implementation that would pull dialogue from a source file (...
1
vote
1answer
85 views

delta_time with discrete movement

I have a basic snake game movement system with Pygame: ...
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
1answer
186 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
85 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
vote
1answer
65 views

Moving Rect with KEYDOWN

I tried to move my obstacle with the event type KEYDOWN, but it seems it is not working. This is my code. ...
1
vote
0answers
107 views

Avoiding Global Variables in Event Driven Programming

First off is "procedural event driven programming" a thing? My question is about global variables in the context of an event driven program that doesn't use OOP... I have written a simple Snake game ...
1
vote
0answers
99 views

Rolling a circle around a square

I am stuck on a simple Box2D task. I have a box and a ball (in top-down view so no gravity), and I would like the ball to roll around the box. Here is my code. Basically now I am trying to detect ...
1
vote
0answers
130 views

PyOpenGL Cubemap ARB Texture not rotating with gluSphere

I've made a gluSphere render in my display and have given it a cube map texture of the Earth. The texture is visible just fine (see below), but I cannot get it to rotate along with the shape. this ...
1
vote
0answers
78 views

How do I organize this code to be able to have a menu system that can be nested?

I am a beginner programmer and I have been experimenting with pygame (uses python if that is not obvious) through tutorials and such. I am stuck because I have not been able to figure out how to make ...
1
vote
2answers
290 views

Pygame - Maze collisions problem

I am a beginner in Python and Pygame and I have a problem with my game in pygame. I have Maze class and Player class but I can't do proper collisions. I reached the moment where I have no idea why my ...
1
vote
0answers
382 views

Python:Adding enemies and weapons in game (Text-based adventure game)

I'm a beginner in coding and game-design also and try to make text-based adventure game, where player should move between rooms, fight with zombies and pick up weapons. Any help, namely tips and ...
1
vote
0answers
309 views

How do I create a HeightField in pybullet?

I've been looking for documentation on PyBullet, the python implementation of Bullet, but I haven't yet found a way to implement the btHeightfieldTerrainShape collision object, which I need to make, ...
1
vote
0answers
263 views

Pygame collision

I'm making a dungeon game, and I'm making the collision system. There is an object obstacle, which has got these properties: ...
1
vote
0answers
137 views

How can I simulate physics on my curved LED strip?

I have a LED strip with 300 LEDs that I can control one by one: https://github.com/cipold/pyledstrip You can think of them as Adafruit NeoPixels: https://www.adafruit.com/category/168 I have code ...
1
vote
0answers
135 views

Collision for array of pathfinding zombies to array of blocks

Relevant Background Information I'm an eleventh grade high school computer science student in Canada. I'm doing pretty well in the course currently, I have a 96 in the course currently. We're working ...
1
vote
0answers
1k views

Rendering thousands of circles in pyopengl

I am interested in rendering animated 2D vector graphics in python using PyOpenGL. As an initial test, I am trying to render thousands of pixel-perfect circles drawn using shaders. Here is the current ...
1
vote
0answers
668 views

Get original image size in Ren'py

I'm building a visual novel and in one scene, I want to have a couple of different images move from one position to another and change size as it moves. My first position is called "doorway", my ...
1
vote
0answers
1k views

How to rotate a line in 3d space?

I am trying to figure out direction vectors of the arrowheads of an arrow. Basically I'm given a normalized direction vector ...
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
0answers
35 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
1answer
34 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 ...
0
votes
0answers
28 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
39 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
43 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 ...
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
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
13 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 ...
0
votes
0answers
178 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
28 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
71 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
560 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
100 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. ...
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
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
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 ...
0
votes
0answers
59 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 ...