Questions tagged [python]

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

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

Changing background color of image pygame

I'm trying to change my background image color, but somehow it doesn't work, I was googling and asking and I'm new with this, so I hope you will be able to tell me how, and explain me why it doesn't ...
0
votes
0answers
6 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 - ...
0
votes
1answer
228 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
90 views

Pygame Scrolling Bug With Enemys

I have a problem with my enemy where when my player scrolls left the enemy scrolls with the player is there anyway to fix this even Video my full code is below its to long to fit here though what I ...
4
votes
4answers
9k views
0
votes
0answers
28 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
19 views

How do I fix the indentation error in this python game I'm making? [closed]

I am making a little game where you enter a boolean and the computer learns which Boolean it is: ...
0
votes
1answer
45 views

Pickup and drop inventory system in Python [closed]

I need help creating an interactive inventory where there are 3-4 items present on ground in a certain amount, for example, number of swords on ground = 4. I want it to be interactive while keeping it ...
0
votes
0answers
13 views

How to access and use files for games using Python [closed]

I'm experimenting with games in python and I am wondering how to use files, and what to use them for since I have seen many games that use multiple files to operate. How do I use multiple files and ...
0
votes
0answers
18 views

How to make a tile map in the coding of a text-only game [closed]

I recently learned functions and classes in python and am trying to wrap my mind around how to use them to have a map for a player to move on using them. Can somebody give me advice on how to program ...
0
votes
1answer
56 views

I need to add inventory feature [closed]

I am needing to build a text based game for a Intro to scripting class. I have created the basis for the rooms that will be navigated and the code works great for this function, but I am struggling ...
1
vote
2answers
261 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 ...
0
votes
1answer
121 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
151 views

How to create a 2D tile-map in python ASCII style

Still learning about python programming and I wanted to create a little map like below but the thing is I know a for loop will draw down not draw across. However, I want to change the size of the area ...
0
votes
1answer
29 views

How to get object or its index from mouse coordinates? [closed]

Basically, I have a NumPy array of rectangles that store their colour and position. I want to be able to compare my mouse position and clicked on the rectangle's position and get the index or the ...
0
votes
1answer
25 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
1answer
90 views

Why does collision only work sometimes when there are multiple objects in the game?

when i was making a pygame in python for the first time i kinda have a problem where sometimes the player and the object would touch and the game would not close as intended i dint seem to find the ...
0
votes
1answer
268 views

Collisions in other sides on pong in python

Im trying to create pong in python, so far Ive set up correct collisions on the right paddle but upon just trying to reverse the code to work with the other side it refuses to work, simply glitching ...
0
votes
1answer
37 views

Why doesn't my Pygame game scroll properly?

When I am clicking the arrow keys, in order to scroll my ground and my lucky block, I cant just press the key and it keeps on going scroll. So I need to press the key every second to get a kinda ...
1
vote
1answer
71 views

Networking to make a single player RPG into multiplayer

I’ve written a few games in Xcode before and would like to turn one into the simplest possible 2D top-down RPG multiplayer game. Essentially just needing movements around a big tiled map (I love ...
0
votes
0answers
15 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
1answer
16 views

Player not moving camera to the other side of the screen when hitting the screen edge

I'm working on a game where I want the player to appear on the other side of the screen when they get to the edge of the screen, essentially mimicking the background moving. When the player gets to ...
0
votes
1answer
2k views

How do I apply collision to a turtle

I cannot figure out how to apply collision to a turtle. I am in need of help for collision with pen lines and turtles. I want the two to hit and restart the game but I can't get collision on either. <...
0
votes
0answers
17 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
1answer
57 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
12 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 ...
1
vote
1answer
70 views

Domain distortion on a spherical texture (planetary surface)

I am experimenting with procedural techniques to generate planetary terrain. I have close to zero knowledge so I started with something simple, using perlin noise and domain distortion. My goal is to ...
0
votes
1answer
457 views

Is there a way to get relative center of a Rect object in pygame?

Now, suppose I always want to draw a circle at the center of a rect object, now, the problem is: For example, if I do ...
6
votes
3answers
3k 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, ...
1
vote
1answer
56 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. ...
6
votes
5answers
2k views

Programming with Python in a recent version of Minecraft

I've been teaching Python programming to a friend's son using the book Adventures in Minecraft. This book comes with a starter kit that contains a pre-configured Bukkit (v.1.6.4) server, and targets ...
4
votes
3answers
668 views

What resources are available to read and share pyglet code? [closed]

I am a Python programmer (I know the ins and outs decently well), and I have dabbled with Pygame. I want to make 3D applications and games, and so naturally I've been looking at OpenGL. pyglet uses ...
2
votes
1answer
77 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 ...
3
votes
1answer
1k 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 ...
2
votes
1answer
263 views

Creating Dialog Trees in Unity with Python?

I was thinking to create dialog trees with Python in Unity. I was curious if I will using in one project c# scripts and python will not cause problems with compiling scripts. Also I did found few ...
0
votes
1answer
74 views

processing request in order on game server

I am creating a simple multiplayer puzzle game in which multiple players can join a lobby and compete with each other. the player that submits the answer first gets the highest point, the player that ...
0
votes
1answer
611 views

Too slow for cycle in Pygame

I'm using Pygame for Python 2 and I have the following code: ...
0
votes
2answers
710 views

Triangle mesh smoothing

I have a grid in terms of two arrays: points: contains 3D coordinates of points. triangles: contains 3 indices per line for ...
0
votes
2answers
40 views

How can I create a boundary so the sprites don't go off screen?

I'm attempting to create a boundary around the window to stop the sprites of my game from escaping but it doesn't seem to be work, when they hit the area where its supposed to stop them it instead ...
0
votes
1answer
56 views

Animating from json file in pygame?

I have got a json file and I am trying to load the single sprites from that file but I gives this error after a few loops and also the animation is not smooth(gets stuck) error: ...
1
vote
1answer
103 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
2answers
68 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 ...
1
vote
1answer
58 views

Using multiple pygame_gui managers

I would like to structure my gui into different panels. so to help keep my code managable i thought it might be a good idea to have a main panel. with its own manager and then a secondary panel with ...
0
votes
2answers
88 views

How to make planets “stay together” on collision

I working on a 2D planetary orbit simulator and I've encountered a problem regarding the collision of planets. Currently, here is what I have ...
1
vote
2answers
63 views

Box collisions between vehicles in traffic pattern

I'm working on a traffic simulator. Right now, I have ways to manage 4-way stop intersections and a solution for efficiently determining which vehicles are colliding with one another. All vehicles ...
3
votes
1answer
399 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: ...
1
vote
1answer
40 views

The gameloop is stucking the window

I tried to display a player image in a 800x600 window using PyGame but when I try it, the window just gets stuck (immovable with mouse drag, minimize,maximize and close button is stuck and not ...
0
votes
1answer
107 views

Pygame End Screen Problem How To Fix?

Video as you can see there I am trying to make my end screen restart my game but whats happening is that its not restarting my game its just loading the same thing when I die >> how could I make it so ...
0
votes
1answer
2k 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 ...

1
2 3 4 5
11