What's the deal with Deno? We talk with a major contributor to find out. Listen now.

Questions tagged [python]

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

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

Understanding how to add new types of entities to an existing entity system

Slightly generic title, but I found this wonderful code snippet that helped me get nice scrolling working in a little demo I'm working up: https://stackoverflow.com/questions/14354171/add-scrolling-to-...
0
votes
0answers
24 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
21 views

delta_time with discrete movement

I have a basic snake game movement system with Pygame: ...
0
votes
0answers
20 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
17 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
21 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 ...
-1
votes
0answers
34 views
1
vote
1answer
44 views

PyBullet & OpenGL - Rotations are reversed in OpenGL [closed]

Project description: I am writing a basic game engine to help with my PhD topic on multi-agent learning. I am using PyBullet as the backend physics engine and OpenGL for visual display. I have OpenGL ...
1
vote
1answer
69 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
0answers
6 views

exporting blender explosion modifier [duplicate]

does anyone know how to export an explosion modifier in blender and use it in panda3d? I have tried a lot of settings but not sure how to do it, all I want to do is see a mesh explosion in panda3d ...
0
votes
0answers
28 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 ...
2
votes
1answer
34 views

Non-rectangular collision detection in Python and Pygame

I am programming a ray tracer in python, and I have gotten as far as making a character that can move across a 2d plane and change direction of movement when needed. The problem is this: I want to be ...
0
votes
1answer
55 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
40 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. ...
1
vote
1answer
66 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
62 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
33 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
74 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
34 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
42 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
30 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
24 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
23 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
80 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
21 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
64 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
30 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
58 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
46 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
33 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
45 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
65 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
40 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
38 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
25 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
20 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
1answer
79 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
121 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
64 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
273 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
38 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
50 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
81 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
72 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
26 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
48 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 ...

1
2 3 4 5
11