-1
votes
0answers
35 views

How can I make flood-fill work for all 4-match cases?

I am developing a game like Bejeweled, but a bit more complex. Imagine there are 12 x 12 tiles with 8 different tiles. Whenever there are minimum 4 tiles (or more) align in a vertical or horizontal ...
6
votes
3answers
265 views

How do I generalise Bresenham's line algorithm to floating-point endpoints?

I'm trying to combine two things. I'm writing a game and I need to determine the grid squares lying on a line with the floating-point endpoints. Moreover I need it to include all the grid squares ...
6
votes
3answers
232 views

Determine if a set of tiles on a grid forms an enclosed shape

Given a set of tiles on a grid, I want to determine: If the tiles make an enclosed figure If the tiles make an enclosed figure when you count the sides of the board as an edge of the figure If ...
3
votes
1answer
195 views

How to create a grid based on random shapes?

How to create a "grid" using actionscript like the image below? Basically you have an area of 1100x615 which should be filled with shapes that could be rotated and scaled... Collision detection ...
1
vote
2answers
253 views

Filling in gaps in a grid

I have a set of terrain sprites available to represent terrain: Flat North-South Straight Cliff (x 2 allowing for slope direction either way) West-East Straight Cliff (x 2 allowing for slope ...
1
vote
1answer
96 views

Where can I find info on grid based algorithms for stateless AI? [closed]

There seems to be an overwhelming amount of info out there on AI of all kinds, and it's kind hard to digest at once. For my testing purposes, I'm creating a "typical stateless AI", as described in ...
2
votes
1answer
514 views

Path finding in hex grid based game

I'm making a TBS with hex grid. Player can move units from one hex to another using bridges, which will be randomly generated. I'm using cubic and axial coordinate system for my grid, it's well ...
0
votes
0answers
54 views

Tetris-like wall-kicking not working [duplicate]

So I'm making a falling-block puzzle game. It's not a Tetris clone, but the block clusters move in a similar fashion. I want to make it so that if you rotate against a wall, or against another ...
0
votes
1answer
449 views

Grid Based Lighting in XNA/Monogame

I know that questions like this have been asked many times, but I have not found one exactly like this yes. I have implemented a top-down grid based world in Monogame, and am starting on the lighting ...
8
votes
1answer
141 views

Flowfield density conversion

I'm trying to implement flowfield navigation, as described in http://grail.cs.washington.edu/projects/crowd-flows/ but I can't understand how the Density Function in Figure 4 of the paper is supposed ...
13
votes
1answer
952 views

Get ring of tiles in hexagon grid

Thanks to this post I'm able to collect adjacent tiles to a given tile. But I'm pretty much stuck on an algorithm that gives me only a "ring" of tiles specified by an offset. The algorithm given in ...
10
votes
2answers
806 views

Finding shapes in 2D Array, then optimising

I've just been allowed an image...The image below from my game shows some darkened blocks, which have been recognised as being part of a "T" shape. As can be seen, the code has darkened the blocks ...
8
votes
3answers
3k views

Road / river generation on 2d grid map

This is a newbie question, but here it goes: My map is a 2d grid, and I want to generate roads and rivers. The route from the starting to ending point must not be the optimal route in number of ...
4
votes
3answers
514 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 ...
8
votes
3answers
1k views

How to find 2D grid cells swept by a moving circle?

I'm making a game based on a 2D grid, with some cells passable and some not. Dynamic objects can move continuously, independent of the grid, but need to collide with impassable cells. I wrote an ...
2
votes
2answers
984 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?