Questions tagged [python]

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

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

The world crashes after reset

I have this PyBox2D script, And I want all the bodies to destroy and then reset when a Car hits a building. The collision detection works well, so does the destroying of the world, a problem occurs ...
1
vote
2answers
45 views

Attempting to have a group of units create random values independently in python 3 for a salvage loot system

I am working on creating a salvage mechanic for my game. I want different units to calculate salvage after an encounter to randomly determine how much each one was able to scavenge from fallen allies ...
1
vote
0answers
36 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 ...
0
votes
0answers
23 views

Interactive map designer

I've made a simple game in pygame/pymunk. Currently my maps consists of lists with functions, e.g ground_segments = [ground(position, size, shape...), ...] I ...
0
votes
0answers
41 views

Procedural generation for a text adventure game [duplicate]

I'm working on a text adventure game written in Python and I am at the point where I need to implement procedural generation for the map. As the user moves around, spots are generated, so the entire ...
4
votes
3answers
163 views

How can I add biomes to my generated world?

I need a way to generate a world realistically. I want to generate worlds similar to dwarf fortress. My current code for world generation is this: ...
0
votes
0answers
28 views

Collisons with rock and player(spaceship)

I'm trying to make when the rock hits the spaceship or player it should decrease the health from the health bar but when I run it, it doesn't work. The rock decreases the health randomly. How can I ...
0
votes
0answers
47 views

Procedural dungeon generation

Im making a rouge like game, and I need a better way of generating a dungeon. My requirements for a dungeon must be: Have multiple rooms and corridors All rooms and corridors must be accessible My ...
0
votes
1answer
45 views

MMO Chat system methods

I'm working on a little MMO game as a learning experience, the server coded in Python. When a player logs in it pulls their character data from a SQL db and into server memory. It then uses memory ...
0
votes
1answer
71 views

Collision detection / physics for simple game

I am currently working on a mini game for class (first time doing something like this) and I don't really know how to start with collision detection at all. The game I'm creating is a top down sumo ...
1
vote
1answer
48 views

Unexpected behavior of bodies affected by gravity in 2D

I have a simple code that calculates the acceleration of a body every update of my simulation using the Newton's law of universal gravitation and the second law of motion. ...
0
votes
1answer
28 views

Python path finding

Im making a dungeon crawler in python, and I want to make it so that a certain enemy (only 1) will chase you through the dungeon the map is stored like this: [ ['0','0', '0'], ['0','0', '0'] ] ...
0
votes
0answers
22 views

Libnoise bounding box - from spherical to planar

I'm trying to convert a bounding box inside a spherical map (equirectangular image as a result of Libnoise/c++) into a planar projection, but I can't find the correct algorithm for it and I'm not good ...
0
votes
3answers
65 views

Finding an angle between two bodies

I am trying to find angle between vectors a and b. But the cosine for some reason is not within +/- 1, that means that it is not possible to find an angle between a car and a pedestrian... Any help ...
0
votes
0answers
18 views

Preserving original direction when collision changes direction

I have sliding for player characters and it's working, but running into a small issue. The original direction gets lost, and I'm unable to resume the original direction. My characters have a ...
1
vote
0answers
24 views

Which Python package/library is best for this kind of game? [closed]

I'm wanting to make a small scale version of the game Hearthstone and other 2d games that I can implement self-learning ai in. I was wondering which python GUI would be best to display them. It would ...
-4
votes
2answers
76 views

i don't understand what i am doing wrong. (line 29) [closed]

my problem is that i can't use elipse in line 29 ore someting like that. line 29 = elife player_choice == '2':
1
vote
1answer
32 views

Problem with diagonal collision response using PyGame

So I have been having this problem for the last few days and it has me really frustrated. What I am trying to do is resolve collisions with custom hitboxes in PyGame and it looks something like this: ...
0
votes
0answers
20 views

How to detect collision while the animation is running to move an object to the next coordinate?

I implemented SAT collision detection in Python with the GUI library pygame. It is working well, except when the objects are going too fast. I have velocity and acceleration variables. For each loop ...
1
vote
0answers
61 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 ...
0
votes
2answers
50 views

Find angle to a point

I'm trying to find the angle between a point and the left side of my camera's fov. In the picture below the camera (Red dot) is looking towards a polygon (Green) with the fov of the camera ...
0
votes
1answer
34 views

Pybox2d Collision detection explanation

Hi I am working on a PyBox2D game and it became quite complex and I need to learn about collisions, so I made this very simple script in order to learn collision setting more effectively, however I am ...
1
vote
2answers
129 views

How can I make my race game fair with all players and keep it climatic?

I'm making a minigame where up to 5 players have to race against AI or another player(the "enemy"). The race consists of prompts, the current player is asked to press a key in a given amount of time ...
0
votes
0answers
28 views

Fast route for utilizing images produced in python matplotlib (or within Julia) to be displayed in Unity?

I would like to use within Unity heatmaps produced with matplotlib invoked using python or julialang such as the heatmap shown in: Source: heatmap from matplot lib I can invoke python (or Julialang) ...
0
votes
0answers
29 views

Isometric tile selection formula is slightly off

I almost made the isometric tile selection formula work but it seems to be slightly off. It seems to be working correctly when the mouse is hovered over the first half of the tile but it jumps to ...
0
votes
0answers
62 views

Editing this code to put in my own sprites and textures?

I have to make a game for class and have to have scrolling camera, fully textured background, and have the sprite be fluid. I need the rectangle to be turned into a sprite. This code I found on https:/...
1
vote
0answers
49 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 ...
0
votes
1answer
41 views

How do I permanently set the interpolation for every image, sprite, and texture in pyglet to GL_NEAREST in pyglet?

There are plenty of examples of posts that describe how to set the default interpolation of specific images to GL_NEAREST, for example here, but they all have to be run after the image texture is ...
0
votes
0answers
95 views

How to support JS/Python scripting a C++ game engine?

I'm currently writing an Entity/Component/System architecture game engine in C++, and I have the beginnings of a lua scripting system in place, which seems to be quite popular, but I feel Javascript ...
0
votes
1answer
67 views

how to move object in a circle around point?

There are two controllable objects orbiting around a centre block. Unfortunately, I don't really know how to stick them so they can only move around the block (left/a sends them clockwise, right/a ...
0
votes
1answer
31 views

Calculate normal angle in screen space

I'm working on adding billboarded sprites to a game engine, but the engine allows for walking on curved terrain, like spheres. In order to look like the player is walking on the terrain, I want to ...
1
vote
1answer
65 views

Model gets distorted when rotating the camera

I'm currently developing my own 3d graphics engine and I'm having a hard time figuring out why my 3D models gets distorted when rotating the camera around. This is my projection matrix. I'm following ...
0
votes
0answers
76 views

Python - frame buffer and Tkinter

I'm trying to make a simple game in Python that uses Tkinter for the window (Tkinter comes with Python which is why I chose it) and I need to be able to store a frame and then create a new one instead ...
0
votes
0answers
28 views

How could I calculate the distance between the parent and neighbors node when there is a line of sight between two points?

I have completed my Astar algorithm in Python and now I need to convert it to a Theta star algorithm, I have built my line of sight algorithm below, but when I come to my Theta star algorithm I face ...
0
votes
0answers
134 views

Theta Star algorithm with line of sight

I have finished my A star algorithm and I need to add the work of Theta star to it, but I need to call the line of sight algorithm. I'm working on path planning for a UAV and I have created a grid in ...
0
votes
1answer
65 views

Collision detection and solution causes teleportation on corners

I am making my own game engine on Python and I got stuck with collision between objects. ...
0
votes
0answers
29 views

Snake Python 2nd player wont move

I'm trying to code a two player snake game, a the moment the first snake works perfectly but, my second snake won't budge. I used the same layout code for the 1st and 2nd snake but only the first ...
0
votes
0answers
55 views

Pygame Mask Doesen't Detect Collisions

I'm trying to make my game's collisions with masks. I have 6 masks but only 2 works. My code is: ...
0
votes
1answer
38 views

Pygame Updating Display Without Being Told To

The following (abridged) bit of code is inside the main loop. What I expected to happen was the entity's position to update due to velocity, then update again if it's touching a static object before ...
0
votes
0answers
343 views

OpenGL.error = 1282 How to fix it?

I'm running a python script in Nvidia xavier board using a pyqtgraph.opengl and I installed python3-pyqt5 (5.10.1 installed, and qt 5.9.5) When I run this script below ...
-2
votes
1answer
106 views

How should I go about creating a multiplayer pac-man game in python? [closed]

For some context, I am making a Pac-Man game (using pygame) and I need a little guidance on how to structure the multiplayer side (using sockets). I have a few ideas (the first of which I have tried) ...
0
votes
0answers
30 views

How to reset Camera and Hero position at new level in pygame

I'm working on a 3rd level of my game. When the 3rd level begins the Camera and Hero position is getting same value which was left by the 2nd level at the end point. I'm not able to find a way around ...
0
votes
0answers
13 views

MacOS looking for 'vsh.cli' in the wrong directory after installing vsh

I am following this tutorial for introductory Python roguelike development using the library libtcod. when I run vsh rl in the terminal as instructed, I get the ...
0
votes
0answers
91 views

How to scroll background image from start in pygame

I'm making a game which has 3 levels. I have successfully created 2 levels and everything runs fine, but when I try to reach level 3, it loads the background image from the middle and it get stuck ...
0
votes
0answers
65 views

How to create polygonal or elliptical colliders by python tkinter?

I am developing a primitive game by python tkinter (I use canvas). It's not a big project. It's only my own self-challenge to create a game using only tkinter and standard python libraries. My problem ...
0
votes
1answer
330 views

How to make player move into next level in pygame

When my player reaches at the end of the map, I want it to enter to next level. I've created first level and it all works fine. All I want to do is that when player finishes 1st level I want to load ...
0
votes
0answers
38 views

How to implement a simple chat option for server-client based game (blender/BGE)

I want 2 players to be able to chat with eachother. I have a running server-client game, but I'm kind of stuck on this one. Since there are only outdated videos this is an example I need: https://...
0
votes
1answer
121 views

PyBox2D car moves uncontrollably

I am trying to program TopDown Car using python and Box2D (similar to this tutorial: http://www.iforce2d.net/b2dtut/top-down-car ) The steering is so far limited to thres states of wheel rotation, ...
-1
votes
1answer
87 views

How to make player land on platforms more than one in pygame

I'm trying to make multiple platforms (blocks) on screen on which player can jump and land on it. When I just keep only one block, player jumps on it and land easily. But when I create other platform ...
1
vote
1answer
279 views

What is a good algorithm for a stock market simulation?

I am making a text game about investing in the stock market, however I need a better algorithm, as the current simulation just goes up and down randomly. How can I make it so that its a more realistic ...

1 2 3 4 5 10