Questions tagged [hexagonal-tiles]

Tessellating tiles for use as 2d-histogram bins, game boards, etc.

Hexagonal tiles are tessellating hexagons placed adjacently to each other.

The use of this tag is fairly broad, encompassing statistics, computer science and game design.

234 questions
0
votes
1 answer

Highlighting neighboring hexagons on mouseover

I've been trying to port my love2D game into unity for the past day and I've come across one main issue at the moment: I can't replicate the neighbor highlighting. The issue is: If I go from hovering over one hexagon to another, if the hexagon I've…
Ducktor
  • 337
  • 1
  • 9
  • 27
0
votes
1 answer

Mouse position offset by camera position

In my game, I need to get the hexagon that is underneath the mouse. This worked fine before I added a camera system to allow me to have bigger hexagon grids that go off-screen. If I move the camera, it starts acting weird and not getting the correct…
Ducktor
  • 337
  • 1
  • 9
  • 27
0
votes
1 answer

Java - Hexagon location in grid

Im searching for an algorythem to get the location of a hexagon in a grid. I found this one but it doesnt seam to work: for(int i = 0; i < width; i++) { for(int j = 0; j < height; j++) { grid[i][j] = new…
Symlink
  • 383
  • 2
  • 12
0
votes
1 answer

Distance calculation in wraparound hexagonal map

So I'm trying to get the basic calculations for an hexagonal tiled map. I'm using a rhombus style map as shown in this classic gem (check the "rhombus" option): https://www.redblobgames.com/grids/hexagons/#map-storage In my maps, R and Q are not…
DToffe
  • 151
  • 1
  • 1
  • 5
0
votes
1 answer

determine if a particular pixel is within a shape processing

I'm creating an image filter that will create a honeycomb effect by finding the averages of groups of hexagons. This code will generate a grid of hexagons for any given size, and will eventually be limited to the size of the canvas: float unitSize =…
Tessa Painter
  • 2,113
  • 2
  • 16
  • 21
0
votes
1 answer

How to convert x y coordinates to hexbin center coordinates

I'm aware of the hexbin package, but I don't want to summarize the data at this point. I don't draw my plots in R, so I have no need for hexbin objects or many other things in this package. I simply want to convert/round each point's coordinates to…
DWal
  • 2,752
  • 10
  • 19
0
votes
1 answer

Changing surrounding neighbor hexagons to "line" fill mode

I'm trying to make a hexagon grid-based game. I've got some of the fundamentals down (implemented getting neighbors of a hexagon since the library didn't natively have it and also made it so I can recolor each individual hexagon), but I can't seem…
Ducktor
  • 337
  • 1
  • 9
  • 27
0
votes
2 answers

Get coordinates of adjacent hexagon tiles in a coordinate system

I want to highlight tiles in range of a unit which is placed in a system of hexagonal tiles. For example if I place a unit with range=2 on 6|5, I want to highlight 5|4, 6|4, 7|4, 7|5, 6|6, 5|5, 4|5, 4|4, 5|3 and so on... How can I calculate those…
Marco Frost
  • 780
  • 3
  • 12
  • 25
0
votes
1 answer

A-Star Pathfinding | Hexagonal Grip

I'm a newbie and I'm facing such an awkward problem: . It seems like the algorithm has swallowed an extra hex. Could anybody point to my mistake? So here is the code: ('ob' that appears in 1 and 2 is set of 'obstacles') 1.Pathfinding func: private…
voismager
  • 433
  • 4
  • 19
0
votes
1 answer

Using hexagonal image as button

I have a problem: I want to make a honeycomb shape in which every hexagon is a clickable button, but don't know how. I tried to make it by Button() and window() from Tkinter, but its shape is rectangluar. I need its shape to be hexagonal. EDIT: I…
0
votes
0 answers

Trying to fill Hexagon shape with color

I'm drawing a 2d grid of hexagons using the DrawPolygon function. Works great, but I'm trying to figure out how to fill them with a certain color. It would appear the FillEllipse function is only meant for rectangles. Is there something I could…
Kevin
  • 23
  • 5
0
votes
1 answer

Spritekit Hexagonal map: tile detection in end SKAction.

I ask this question because i didn't found any solution for this kind of issues. In fact Hex map support are not very popular. I'am making a game with the SpriteKit Framework. I use SktileMapNode with an Hexagonal map, with 1 set of 4 groups…
0
votes
2 answers

Update canvas on mouse events

I've created a hexagonal grid using this JS library. The grid does get properly painted onto the Canvas. My issue is with trying to introduce events on mouse events. For instance, when I hover over a certain hexagon I want it's background color to…
Simpleton
  • 6,285
  • 11
  • 53
  • 87
0
votes
0 answers

What is easiest way to move towards and along the edge on a hex grid?

I have a hexagonal grid with variable radius. My entity can move exacly 2 hexes per turn. How should I calculate next step towards border and afterwards travelling clockwise around map? Preferred movement at the boundary Character should stay at the…
warbaque
  • 583
  • 1
  • 8
  • 18
0
votes
1 answer

Hexagon grid - paths incorrect

I am writing a program that uses a hexagon map (obviously in the output seen below it appears as a square, but the numbers will make sense for a hexagon shape) to generate a path from a certain point. 0 indicates the goal, -2 indicates an off limits…