tile

Is there an algorithm for combining threat range with arbitrary move range on 2D grid?

北慕城南 提交于 2019-12-07 14:18:37
问题 I'm building a simple 2D grid based game and am looking for a way to calculate the "threat" area that each character can exert on the game board. Threat from the current spot is easy to calculate - this is the red diamond below. But I'm looking to combine this information with an arbitrary "can walk here" area (orange). Together the algorithm will give me a combination of all tiles that my character can attack from all available moves and current position. Of course I can just iterate over

Three.js tile which has multiple textures using plane geometry

核能气质少年 提交于 2019-12-06 04:38:51
问题 So I am trying to build a 3D based world consisting of tiles. I have successfully managed to do this using the plane geometry and height values etc. But now I have come to a point where I possibly have to change everything. The problem is that I want a tile to have multiple textures (using a shader because I want to blend them). I was able to do this globally (so each tile would have same textures + using some uv mapping). However I fail to understand how I would be able to specify which tile

Is there an algorithm for combining threat range with arbitrary move range on 2D grid?

守給你的承諾、 提交于 2019-12-06 00:49:50
I'm building a simple 2D grid based game and am looking for a way to calculate the "threat" area that each character can exert on the game board. Threat from the current spot is easy to calculate - this is the red diamond below. But I'm looking to combine this information with an arbitrary "can walk here" area (orange). Together the algorithm will give me a combination of all tiles that my character can attack from all available moves and current position. Of course I can just iterate over all possible moves, apply the diamond shape there and create a set of all threat squares. Is there a

tiled map on android

别说谁变了你拦得住时间么 提交于 2019-12-06 00:26:08
I want to implement an offline map of an area(city size), I need to use tiled map with several zoom levels and be able to zoom in/out by pinching on the map, double tap, pan and so on. I don't want to use OpenStreetmap. The map I use is a transit map, so it is very different from openstreetmap. I have tools to cut the map into tiles. I wonder if there is any free library that I can use, I know this question has been asked(like android tiled map technique ) but I could not find an acceptable answer. I am aware of the mAppWidget, but it is too expensive. Would appreciate any help or hint. There

Overlay ggplot grouped tiles with polygon border depending on extra factor

喜你入骨 提交于 2019-12-05 23:15:29
I have a data frame with x and y positions and two factor columns blocknr and cat: dput(testData) structure(list(xpos = c(2L, 8L, 5L, 8L, 1L, 4L, 5L, 1L, 8L, 4L, 3L, 2L, 6L, 5L, 1L, 7L, 3L, 4L, 3L, 7L, 1L, 6L, 7L, 7L, 2L, 5L, 3L, 4L, 6L, 7L, 1L, 5L, 1L, 6L, 4L, 5L, 3L, 6L, 4L, 8L, 1L, 3L, 4L, 6L, 7L, 3L, 2L, 6L, 4L, 2L, 1L, 7L, 4L, 8L, 2L, 3L, 2L, 5L, 8L, 2L, 8L, 3L, 3L, 5L, 6L, 7L, 1L, 5L, 6L, 4L, 2L, 6L, 7L, 1L, 5L, 7L, 2L), ypos = c(1L, 2L, 8L, 1L, 6L, 7L, 1L, 4L, 6L, 1L, 2L, 3L, 4L, 5L, 7L, 8L, 10L, 2L, 6L, 9L, 1L, 2L, 10L, 4L, 5L, 6L, 3L, 5L, 9L, 3L, 9L, 10L, 3L, 7L, 8L, 2L, 5L, 6L, 3L,

Generate Tile Map from array

人盡茶涼 提交于 2019-12-05 21:57:09
I've been thinking about trying to create a RPG game, a simple game with movement, pick up items, and open doors. I've been thinking for a long time about the tile map engine, but i can't find anything that works :/ Basically what i'm trying to accomplish is i have an enum , like: public enum tileSort { Dirt, Grass, Stone, Empty } And when the engine runs through the array, which will have 0's, 1's, etc, I'm thinking about a switch statement, something like: switch(tileSort) { case '0': tileList.Add(Content.Load<Texture2D>("Tiles/grass")) } The problem is that I have no idea on how to make

Tiled Map Editor: size of isometric tile side

你离开我真会死。 提交于 2019-12-04 15:32:43
In Tiled editor there is an isometric map example: "isometric_grass_and_water.tmx". This example shows simple isometric map with tiles which have size 64x32 pixels. I need to know size of the side of a tile, so I simply used Pythagorean theorem for this: In right-angled triangle ABC side AC = width / 2 = 32 and side AB = height / 2 = 16. Thus side of a tile (BC) can be calculated as: So whole tile is a rhombus in which each side = 35.777. However when I add an square object with dimensions 35.77 x 35.77 to the Tiled, it not fits into the grid (it is actually bigger than on tile). But if I add

Three.js tile which has multiple textures using plane geometry

拈花ヽ惹草 提交于 2019-12-04 10:25:13
So I am trying to build a 3D based world consisting of tiles. I have successfully managed to do this using the plane geometry and height values etc. But now I have come to a point where I possibly have to change everything. The problem is that I want a tile to have multiple textures (using a shader because I want to blend them). I was able to do this globally (so each tile would have same textures + using some uv mapping). However I fail to understand how I would be able to specify which tile has which textures (and I have about a 100 textures), since the plane geometry has only 1 shader

How do you load a tmx/xml file in javafx?

你。 提交于 2019-12-04 05:51:28
问题 What is the most efficient way to add a tile map in a JavaFX program? The program that I use for creating tile maps is called "Tiled", and the saved files are in .tmx format. Now, the question is, how do I import that exactly in my 2d game? I haven't been able to find helpful information on the net. Code examples are greatly appreciated. Thanks 回答1: Use the Eppleton JavaFX TileEngine (unfortunately this link is now dead: similar content is still hosted on javageeks: Beware link comes with

Mango Application Tile - remove back

◇◆丶佛笑我妖孽 提交于 2019-12-03 23:57:17
问题 This is a simple question, and a seemingly simple task but I can't find any info on how to accomplish what I need to do. I have an application whose main tile (when pinned) sometimes needs to be the default, single sided tile and sometimes needs to have information displayed on the back of the tile. I can add the BackBackgroundImage, BackContent and BackTitle successfully from the ScheduledActionService, but I can't remove them when they are no longer required. This isn't a secondary tile so