Questions tagged [python]

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

Filter by
Sorted by
Tagged with
-1
votes
0answers
24 views
-1
votes
0answers
17 views

Enemy A/MovementI in Pygame, idle and aggressive bosses

Working on my first project and I'm trying to get enemy movement sorted, the code below is my current implementation. The enemy using the distance between the player position (target.pos.x) and their ...
-1
votes
0answers
36 views

Creating an engine using python [closed]

I want to create a game engine and later use it to create games in 8 bit style. I know I don't need to do this but I want to do it anyway. I got heavily inspired by The Cherno. I'm just starting and ...
0
votes
0answers
36 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
2answers
36 views

Rotating Cannon's Mouth Toward Player

I am trying to make my cannon mouth rotate towards player, but the rotation is messed up and up I don't know how to fix it. ...
0
votes
1answer
45 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 ...
0
votes
1answer
54 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
votes
1answer
31 views

python sockets: receive data only when data is available?

I am writing an update to a game I have written in python, and I am currently adding server support. I can't show you the main code (for the client), as it is hundreds of lines long. However, what I ...
0
votes
2answers
61 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 ...
0
votes
1answer
30 views

EndScreen Not Loading My Best Score And Current Score How To Fix?

I am trying to make my endscreen save last score and current score but it just appears as 0 for both everytime I die event he I picked up the coins image so basically it isnt saving my coins I had and ...
0
votes
1answer
34 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
0answers
18 views

Enemies Bullet Shooting At Player Problem How To Fix?

I am trying to make my enemies shoot at my player rect where ever the position the player is and when it collides with the rect it should remove the -1 health ***my problem is that when the enemy ...
0
votes
0answers
20 views

Problem WIth Enemies Bullets PyGame

I am trying to make my enemy shoot my player but for some reason the bullets arent showing nor they are shooting at the player I don't even know why, I even draw the bullets on my window VIDEO ...
0
votes
0answers
24 views

(Pygame) Bouncing projectile gets stuck at window edge, rapidly bouncing back and forth

I've just started developing with Pygame and I figured that as my first project I would try to bounce some Rect objects around. I saw a sample of a bouncing ball here, and when I copied the code and ...
0
votes
0answers
18 views

Pygame Tiled Map Object layer collision

I'm using pygame to make a top down shooter I've placed my tiles and object layers using Tiled Map Editor. My player and mobs collide with their spawn locations (object layer) is anyone able to help? ...
0
votes
1answer
77 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 ...
0
votes
0answers
17 views

How to call Python script in Unreal Blueprint and pass argument to it in Blueprint?

How to call Python script in Unreal Blueprint and pass argument to it in Blueprint? Would appreciate any advice.
-1
votes
1answer
54 views

How do I debug OpenGL apps written in python?

How do I debug OpenGL apps written in python? I tried but I was unable to use standard tools like nvidia nsight or glsl-debugger or renderDoc on python code.
0
votes
0answers
15 views

Rock paper scissor Lizard spock

I have been trying to code R-P-S-L-SP game on my computer but it has another argument which makes things hard. I need to code the game inside of a maze! My problems starts where to use my classes and ...
0
votes
1answer
32 views

Player won't move correctly due to gravity force pushing him into the ground

I am making a tilemap platformer with pygame ad I defined the X and Y movement for the player and also a Y force that represents the gravity force to make it jump correctly. However, when my player ...
0
votes
1answer
30 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 ...
0
votes
1answer
56 views

How do I make my level scroll side-to-side as the player moves?

I am trying to figure out how can I make a side-scrolling view in Pygame. If I am moving right or left, I want the portion of the level shown on-screen to shift to follow the player character. Here ...
0
votes
1answer
44 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
31 views

How to map texture across whole face?

I'm trying to map a texture to a square face in OpenGL 3.2, but the texture gets tiled in the upper right corner. I've tried changing the uv coordinates, vertices and shaders, but nothing seems to ...
0
votes
0answers
20 views

the identifier “icon” is not declared in the current scope [duplicate]

(Sorry if i have spelling mistakes i am Bulgarian) I have the problem that my "icon" isn't declared in the current scope. i am trying to add an object (body, collisionshape, and a sprite) this is ...
-2
votes
1answer
40 views

how do i make it so you can hold down a key to keep moving

so I am trying to make my first working game and it is not working. There is no error message, it just does nothing. I want the box guy to move right or left when you hold down left or right arrow key,...
0
votes
1answer
60 views

How to add multiple floors to a map in a text-based game?

I decided to learn how to make games during this quarantine. I am reading Mission Python, a book that teaches how to make games using python and pygame. I'm halfway through it, but the game only has ...
1
vote
1answer
36 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. ...
0
votes
1answer
37 views

How to make controlled exchanges in an online-game?

There is an online game in which you can collect things of different values: ordinary, epic, legendary. The cheapest things are ordinary, the more expensive are epic, and the most expensive are ...
0
votes
0answers
21 views

Animating Game Objects at Different Speeds

I want to animate multiple game objects at different speeds in the context of Python Turtle Graphics, and I'm confused about my options. One approach is to use separate timers for each object, as in ...
0
votes
0answers
19 views

Assigning a User a Class [Python]

I have a classes Mage and Warrior and I want them assigned to the user when they choose which class they are, How can i do that? Here is my code,I don't know how much you need so I am sending it all....
0
votes
0answers
31 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 ...
1
vote
1answer
73 views

Why is my program “not responding” when I run it?

I'm trying to learn to code with python and while using pygame, I came across this: every time I run the window it says "not responding". Specifically, it happens when I click to drag the window; the ...
1
vote
0answers
53 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 ...
0
votes
0answers
143 views

How can I remove a sprite from the screen using pygame?

I am having trouble with removing sprites on my screen using pygame. I am killing my sprite with sword.kill which is removing it from an all_sprites group, so it should disappear right? Here is ...
0
votes
0answers
36 views

How do a make a smooth animation with images of different sizes in pygame?

I have an animation where my player swings his sword, with 5 images in pygame. The normal resting image is 14x22, and the rest are 13x23, 21x23, 18x23, and 18x23. I am having trouble with my character ...
1
vote
1answer
44 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 ...
0
votes
0answers
56 views

pygame multiple collisions between two objects

Ok, so I have been trying to figure out how to set this up and can't get it working properly. I'm trying to get the functionality similar to the moving logs in the game Frogger if you are familiar ...
1
vote
2answers
50 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
56 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
25 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
46 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
396 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
32 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
62 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
58 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
93 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
53 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
39 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
26 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 ...

1
2 3 4 5
11