Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [python]

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

0
votes
0answers
20 views

Generating a tile map in pygame

I have this code that, in my opinion it should work, but it don't. So far I figured out how to get the tile position and position in windows of the top left tile but I can't do the other tiles. I am ...
0
votes
0answers
32 views

Snake game with Sprites python

I've been trying to make a game of Snake (I'm a beginner/intermediate, so this is a way for me to try to get the basics of new things I learn), and I've been trying to do it with sprites. I would ...
0
votes
1answer
37 views

Finding Closest of 8 Possible Angles to Theta Value

I'm working on creating a gesture recognition system, and I saw one simple implementation that isn't as accurate, but is really easy to implement. The idea is that you have a unit circle with the 8 ...
0
votes
0answers
17 views

Rpg like texas hold-em without being too unfun to play against

What would be the best way to create texas holdem (and AI for it) without being too strong to play against and also have a way for AI to "cheat" (ie game giving AI good cards on river/draw) based on ...
0
votes
1answer
21 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
0answers
23 views

Cant load image into Pygame

I just started to get into python and pygame and i've been trying to load an image into a pygame window using Thonny, I saved the image and my code file into the same folder but an error message keeps ...
0
votes
0answers
20 views

Why doesn't my pygame window close on MacOS?

I am trying to create a window and then close the window. Everything runs smoothly until I click the red X. When I click it, the window doesn't close and all that happens is that the colourful red ...
0
votes
0answers
25 views

Wii accelerometer data ranges

I have 2 related questions, please. I am using a wiimote on a robotics project and I need to convert X and Y values into new bounded values. So, give the following accelerometer data: ...
2
votes
2answers
71 views

Generating different maps using Perlin Noise with a seed

I am developing a 2D game in python and I could get Perlin Noise working with this code: ...
2
votes
1answer
40 views

Perlin Noise generation always returning zero

I am using noise and I can't get Perlin Noise working, only the Simplex Noise. So far I got this: ...
0
votes
1answer
30 views

Python: I have a python statement which should work but it doesn't [closed]

The error in the picture is highlighted in red. So, I have used this code on another computer and it worked, why wont it work now? I may have made a really small and stupid error and if I have I'm ...
0
votes
1answer
21 views

Determining which way a wall faces in a 2D grid with minimal boilerplate

I have a 2D grid of quadrilateral tiles, some of which are walls, some are floor; each tile has four vertices, which are shared with the tiles around it (so each rendered "wall" is at least two wall-...
-1
votes
0answers
28 views

enemy in the room -text based adventure game (python)

How to cope with error "TypeError: 'type' object is not subscriptable" ? I'm, dong a project on text-based adventure game, where player can move between rooms, pick up items and attack zombies. But,...
0
votes
1answer
38 views

Getting event types in Pygame

I want to have the type of an event from the event queue to decide certain actions (i.e. if it is a joystick event or a keyboard one), but the dir of events is an ...
1
vote
0answers
70 views

Python:Adding enemies and weapons in game (Text-based adventure game)

I'm a beginner in coding and game-design also and try to make text-based adventure game, where player should move between rooms, fight with zombies and pick up weapons. Any help, namely tips and ...
1
vote
1answer
48 views

How to resize a surface in Pygame?

How can I resize a Surface object in Pygame? Is there a way to bind a surface object into a Rect object, so that resizing the ...
1
vote
1answer
49 views

How to get camera to follow car

i am making a top down racing game where the car progresses along the track, however i need the camera follow the car as it progresses through the track. I am unsure how to fix the error. I am new to ...
0
votes
2answers
82 views

Pygame platformer - Making sprite jump

I am currently trying to make a Mario-type platformer using pygame and the MVC design pattern. My progress as of right now is getting a character on screen and having it move left and right. My goal ...
2
votes
0answers
54 views

Non-Perfect maze generation with objectives [duplicate]

I need an algorithm that can generate mazes with these requirements: Allows for random structures to be made (Ex: a center spawn area, objective points and 'Caverns (corridors with 2 or more ...
-1
votes
0answers
37 views

Astar Backtracking [duplicate]

I am using OpenCV to code an image based A* algorithm. Using the image, a grid of clear paths and obstacles are created, which the algorithm is run on. The red squares are obstacles, and the yellow ...
0
votes
1answer
49 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
0answers
48 views

Connecting nodes for pathfinding algorithm

I am attempting to build a program where a user is able to select a starting and ending point on a map, and the shortest path between those two points is displayed. My code should work for all maps ...
0
votes
1answer
106 views

Using PyOpenGL, can I rotate raw data rather than the current matrix?

I'm trying to create a sort of PyOpenGL renderer for the Bullet physics engine, and at the moment I'm rotating my basic cubes with math in Python. However, if I do the math in Python that's going to ...
0
votes
1answer
46 views

First “If” Enemy Selection Function being recognized as a syntax error in Python

I have an issue with trying to under the syntax error with the line if enemy_select = 1: in this type of code: ...
3
votes
1answer
316 views

Adding character stats/traits in Ren'py

I'm coding a relatively simple VN with RPG elements in Ren'py, with little prior programming knowledge. There's one aspect that I can't simplify further because it's important to the game's branches, ...
2
votes
1answer
124 views

Pathfinding, 2+ tiles wide

I recently started learning python and I'm working on a dungeon generator, using images for the rooms, hallways and junctions. Example of desired result. So far I managed to generate a X * Y map and ...
0
votes
2answers
117 views

“RuntimeError: Validation failure (0)” using shaders

I'm trying to move away from using glVertex() in my game code because it doesn't seem to work well with a large quantity of vertices. At the moment I'm trying to make code that uses Shaders, but when ...
-1
votes
1answer
109 views

Converting code to work in godot with sliders

I have some Fragmentarium code that I would like to convert so it will work in Godot anyone have any ideas how I can do this? The code is below: ...
1
vote
0answers
91 views

How do I create a HeightField in pybullet?

I've been looking for documentation on PyBullet, the python implementation of Bullet, but I haven't yet found a way to implement the btHeightfieldTerrainShape collision object, which I need to make, ...
0
votes
2answers
144 views

maya script editor: how to keep python code after execute

see my gif, in script editor, I hope keep python code after code is executed and run it again next time, how should i do?
0
votes
0answers
67 views

The websocket messages in my online game are being served too slow

Im attempting to make a online game in python, though I have ran into a problem. Basically I want the game to be playable in many regions, but the websockets are to laggy to be played in farther ...
0
votes
1answer
42 views

Terrain Rendering/Update Failure Python 3.x

I have begun to create a procedurally generated RPG using Python, and I am having trouble with rendering the terrain. What is happening: I generate some terrain from some files, or create/save new ...
0
votes
0answers
50 views

Kivy - Why are .kv files preferred to drawing in python?

I'm trying to get a game I'm working on in python running on Android, so I'm learning about Kivy, which is very simple to build. It's currently all in pygame, drawing and blitting to surfaces and ...
1
vote
2answers
103 views

Trouble creating a “Game Log” for a text-based RPG

I've made significant progress porting my game from print-output to Pygame over the last few days, and I think I'm almost there! Unfortunately, I'm beginning to suspect one of the methods I'm using ...
-1
votes
1answer
52 views

Having trouble making more than 1 clickable object

I am a student trying to figure out how to make multiple clickable objects in pygame. I was able to make 1 working clickable object (dx,dy) work, but when I tried to make another clickable object (qx,...
0
votes
1answer
72 views

How do I port a game which uses print-output to pygame font rendering with the least amount of work?

I've been working on a text based RPG. It's pretty simple, I'm not very experienced with Python, or any other language for that matter. Edit: For context, I recently posted this question: Python 3: ...
0
votes
1answer
189 views

Python 3: How can I make my Text-based game windowed?

I've been making a text-based RPG in Python, and I'm a bit lost in transitioning from a console to a window. I'm not trying to do anything fancy (I think). I'd like my text to display normally, as it ...
0
votes
1answer
70 views

How do I let game maker know that recieved json data is an array?

In python I created an array called lobbyList = ["Awesome","Funny","Epic"] I sent this array to Game maker studio 1.4 using JSON, I made a variable called ...
0
votes
0answers
266 views

IronPython with Python in Unity: How should I manage dependencies Python-side?

I am currently trying to get Python working in Unity, and I was wondering how would I manage dependencies on the Python end. For example, say I have a Python script with the following dependencies: <...
1
vote
1answer
984 views

Using CNN's in Unity via Tensorflow and TensorFlowSharp

I have a project that tracks hands made in python, shown here: https://github.com/timctho/convolutional-pose-machines-tensorflow I want to effectively import this into Unity. I have generates the ....
1
vote
0answers
95 views

Pygame collision

I'm making a dungeon game, and I'm making the collision system. There is an object obstacle, which has got these properties: ...
4
votes
2answers
164 views

Simple 2D games - what is faster to render - images or drawing?

I am developing simple 2D environment in Pygame (Python 3.6), however I think this question is general. The environment is moving (player is rendered on the same position and everything else is ...
0
votes
0answers
70 views

Performance issue for simple pong game in pygame

I have made a simple pong game in pygame, where enemies and items fall down. However, even though it runs at 60fps, it stutters really often which leads to the game being annoying to play. I have ...
1
vote
1answer
410 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 ...
0
votes
2answers
187 views

How to move a sprite quickly whilst animating it?

At the moment I am creating a program in Python, and Pygame, similar to Fire emblem, so a game that has a tile based system in which the sprites use to move to and determine location. I have been able ...
1
vote
1answer
146 views

How can I add 3D animation to my Pygame window?

I've developed a quiz game using Pygame but now I'm being asked to implement a 3D animation element (a game show host) to the game. I used Pygame as I was told it would be an easy enough language to ...
1
vote
1answer
122 views

Can somebody explain this behavior in pygame?

I have an image that I'm rotating and moving And when the rotation angle is negative the image moves as expected. But when the angle is positive it moves it's origing point to the left Can anybody ...
1
vote
1answer
319 views

pygame KEYUP KEYDOWN events only once per frame?

I've been playing around with pygame, and I ran into a bit of an odd issue with input on the pygame event queue. Consider the following test code: ...
0
votes
1answer
125 views

How to Prevent Sticking to Overhead Slopes

I am having an issue with overhead slopes in my 2D platformer. I implement slopes using a LineSegment class. My player sprite has a spine attribute which is just a line segment from the midtop of his ...