# Tag Info

Accepted

### How do you create a perfect maze with walls that are as thick as the other tiles?

If I understand you correctly, you want to create a densely packed maze like this, where each wall is the same thickness as each corridor: But you say the maze algorithms you've found only deal with ...
• 135k
Accepted

### Efficient Algorithm for the boundary of a set of tiles

Finding an algorithm is usually best done with a data structure that makes the algorithm easy. In this case, your territory. The territory should be an unordered (O(1) hash) set of borders and ...
• 371

### Efficient Algorithm for the boundary of a set of tiles

If you need to find edges of holes in the middle of your territory too, then your linear in the area of the territory bound is the best we can do. Any tile on the interior could potentially be a hole ...
• 135k

### How can I make the player "look" to the mouse direction? (Pygame / 2D)

First you need to calculate the vector pointing from your player to the current mouse position. This can be done by subtracting the player's position with the mouse's position: ...
Accepted

### Making dialogue different with each playthrough

There's a great GDC Talk by Elan Ruskin of Valve on what they call "AI-Driven Dialogue through Fuzzy Pattern Matching" or "Rule Databases for Contextual Dialogue and Game Logic" - it's the system that ...
• 135k

### How do I know the data has arrived at server without requesting every frame of the game?

REST is not the right paradigm for bidirectional communication, because with REST you can not send data which wasn't specifically requested. Hammering the server with repeated requests is not a good ...
• 120k

### Efficient Algorithm for the boundary of a set of tiles

Notice: Whether or not a tile is on the boundary only depends on it and its neighbors. Because of that: It is easy to run this query lazily. For instance: You do not need to search for the boundary ...
• 27.3k

### Add Boo or Python to Unity 5

Unity's primary development language is C#. I am not aware of any way to add a new scripting language to Unity which works just like a native one. But you can call Python from C# using IronPython. ...
• 120k

There are a wide variety of ways to interact with Minecraft programatically, including an official Javascript "add-on" API to the "bedrock" version of Minecraft, APIs for Minecraft ...
• 191

### How do I sort with both depth and y-axis in OpenGL?

You'll need An orthogonal Projection Matrix. In fixed pipeline openGL: glOrtho(0, screen_width, screen_height, 0, -(1<<16), 1<<16) A wrapper function ...
• 467

### Too slow for cycle in Pygame

Your problem here is that this does not work for CPU, it should be done using GPU, probably you can access it in pygame. It's the work of pixel shader and it works on very low level, with thousands of ...
• 2,856

### How can I add biomes to my generated world?

A common technique for generating random worlds with large biomes is to use stock noise algorithms like perlin noise or simplex noise. Such algorithms generate noise patterns which generate a kind of "...
• 120k
Accepted

### Efficiently find all points within a circle

About this algorithm: You don't have to check whether every object is inside the circle. If a node square is completely inside or outside the circle, you can use all objects in it directly without ...
• 2,771

### Rotating hitboxes in PyGame?

Building on Tyyppi_77's answer above, there are a few approaches you can take: 1) Resizing the hit box (as he suggests) - although you can do it much much easier just by using image.get_rect(), which ...
• 191
Accepted

### 2d MMO world generation?

I couldn't tell from your question if your world is top down or side on. But I'm going to assume top down for my answer. If you just want the blocks to be totally random, all you'd need to is go ...
• 435

### Can OpenAL be used with Python?

PyOpenAL (released Dec 17, 2019): https://pypi.org/project/PyOpenAL/ pip install PyOpenAL You can use original OpenAL API but PyOpenAL has helpful wrapper functions....
• 131

### PYGAME: When I release two directional keys together the player keep moving

In pygame (and many other frameworks like it), events are received in an event queue. Multiple events can arrive per frame, for example when you press or release two buttons together. You need to ...
• 14.8k
Accepted

### A python script controlling a Unity game

Ok so first follow this tutorial. Then i wrote some code to try and test it out. C# code. I used the editor example from the tutorial but you can make it run during runtime or what ever: ...
• 3,027

### Locking the frame rate in pygame?

clock.tick() only sets the loops at intervals of milliseconds, so at 60 fps, it will make each game loop at 16 milliseconds, not 16.6666 (which is what you need) ...
Accepted

### Performance drawing in Pygame

I resolved the issue I was facing severe fps drops using my background image and blocks. Though I changed it so when I loaded them into my program, I used .convert() at the end. The .convert() made a ...
• 69
Accepted

### Three levels deep composition (player<-character<-spell), with preset character+skill sets

This looks like a job for the Flyweight Pattern! (Closely related to the Type Object pattern) Here you separate the concept of a character archetype from the instance of the character itself. You ...
• 135k
Accepted

### What is the difference between Pygames, Pyglet and Kivy and how each helps python game development?

The difference between the three frameworks/engines is the abstraction level. Pyglet is low level compared to the other two and is based on SDL, a popular C++ multimedia library. You'll have to use ...
• 14.9k
Accepted

### Python/Kivy game for steam

In the end, i found the answer hidden within their docs https://kivy.org/docs/guide/packaging-windows.html You then need to set console=True to ...
• 141

### Separate objects for hitbox and sprite?

Instead of making your player object inherit from the sprite class you could use member variables for the sprite and rect. Your player class can then stand alone, and have separate sprite and rect ...
• 810
Accepted

### Need help with simple octree implementation

When you do newCentre = self.centre then that doesn't create a new array, but it uses the same object instead. If you modify ...
• 14.9k
Accepted

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

This sounds like a pretty classic abstraction problem, general to all programming and not just games. I'll provide some explanation in terms of a text game though to suit your question. Absolutely ...
• 41.9k
Accepted

### Perlin Noise generation always returning zero

A quick recap of how Perlin noise works: It starts by finding the cell your sample point lands in within an integer lattice. From that it determines the integer points that define the corners of that ...
• 135k
Accepted

### Generating different maps using Perlin Noise with a seed

Looking in the code, the library provides noise.randomize() which states: Randomize the permutation table used by the noise functions. This makes them ...
• 12.4k