1
vote
1answer
123 views

How to get the angle to an object from angle you are facing [duplicate]

I am making an creature simulator where the creatures have a neural net for a brain. One of the inputs to the net is the angle it has to travel to go to be facing the nearest piece of food. I can get ...
0
votes
1answer
124 views

How to make healthbar size relative to hp

Like in most games with healthbars, the units in my game have a hp_bar object which is a frame, with a slightly smaller rectangle inside which should get smaller (and change color) as a unit loses hp, ...
3
votes
2answers
249 views

How to implement armor? [closed]

I am a newbie in Python, I am very bad at math too and I need some help. Also close/move this post if you feel this isn't the right place for it. Hero1 = 5000 # His HP is 5k. Hero1dmg = 200 # ...
0
votes
1answer
162 views

Using NumPy arrays as 2D mathematical vectors?

Right now I'm using lists as position, velocity, and acceleration vectors in my game. Is that a better option than using NumPy's arrays (not the standard library's) as vectors (with float data ...
5
votes
2answers
737 views

How to render metaballs?

How to render metaballs? I am a Python programmer familiar with the Panda3d and Blender3d APIs. My math kinda sucks, but I know enough to write game logic code and procedural model generation code, ...
2
votes
1answer
367 views

Blending colors on Surfaces in PyGame?

So I'm making a game in Python and PyGame. I have aliens and blocks that each adopt one of several colors; rather than make several copies of them in different colors, I plan on making the sprite ...
3
votes
2answers
930 views

Python float 32bit to half float 16bit

I'm trying to write a 3D model exporter addon for Blender in Python and need some help. The spec of the 3D format uses some compression on the vertices, there is a vertex buffer that contains ...