Tagged Questions
0
votes
0answers
146 views
2D tile-based collision: avoid tunneling
We have a box that tries to move from A to B. In order to avoid tunneling we need to check if there is a collision in the path described by its four corners.
Let's focus on the bottom-right corner of ...
1
vote
6answers
448 views
Is it good to sort objects list before every rendering?
I need to render a "tile" game, which are like these:
or
or
I don't know how to render them in correct order. I intend to perform a sorting operator before every rendering (depending on their ...
6
votes
2answers
233 views
Algorithm to select all cells inside rooms/regions
I have a 2d game map consisting of several 'rooms'
For example, here is a 2D map grid: (Brown cells = wall tiles)
If I click on a tile (that isn't brown), I would like to obtain an array of all ...
6
votes
1answer
308 views
Elegant autotiling
I'm looking for information about how people implement autotiling in their tile-based games. So far I have always improvised it with a bunch of hardcoded "if ... else ..." statements, and now I ...
0
votes
1answer
170 views
Iterating 1D array and getting 2D tile position
I know I'm missing something very obvious here, but I have a 1D array that contains integers.I have a map that is 30 x 30 and the center coordinate is 0,0 (This is actually 3D, but I'm essentially ...
5
votes
4answers
365 views
Find nearest tile of type x
I currently have an array of tiles which makes up the tilemap (stored as an int array) and I want an NPC to be able to move itself to the nearest tile of type X (ie find the nearest tree and chop it ...
4
votes
3answers
318 views
Creating the nodes for path finding during run time - more like path making and more
I'm making my 1st game. I'm using javascript as I currently want to learn to make games without needing to learn another language but this is more of a general game dev question.
It's a 2d turn-based ...
9
votes
5answers
522 views
Increasing the probability for similar tiles to generate next to each other
I'm working on a tile map system, which insofar looks like this (green is grass, air is white, stone is grey, and blue is water):
It uses a simple random number generator so that there's a 45% ...
5
votes
2answers
604 views
Tile pair matching algorithm
I'm trying to make a tile matching game. User can select a pair of tiles from a square grid, and if they match, both are removed from the grid.
Tiles are matched if:
they are of the same type ...
4
votes
2answers
162 views
What is the best way to store temporary selected characters and their insertion order?
I'm developing word game similar to word mole. I'm having a hard time determining how to store temporary selected character (and in turn will changed into word).
Here's the situations. Say, I have ...
11
votes
3answers
7k views
How can I create a random “world” in a tile engine?
I am designing a game that is working on a classic tile engine, but whose world is generated randomly. Are there existing games or algorithms that do this?
The procedural generation algorithms I have ...
7
votes
1answer
971 views
Finding out which tile a mouse click landed in
I am working on an isometric grid based game and im having an issue trying to link a mouse click from the user to a tile. I have been able to split the problem into 2 parts :
Finding a rectangle ...
2
votes
2answers
633 views
Path finding in grid for objects that occupy more than one tile
In a grid-based game I am working on, I want to add objects that occupy more than one tile of the grid. Are there any algorithms or techniques to find paths for this kind of objects?
6
votes
2answers
352 views
Making a symbol appear on any colour
I'm developing an RPG/roguelike-style game. Instead of having maps like:
.........
.........
....@....
...h.....
Oh look, a dwarf.
I was having solid background tiles, So sort of a tile based RPG ...