Hot answers tagged

26 votes
Accepted

How can I implement persistent state for objects defined in a level?

I think not overthinking this issue will give the best results so I would just implement a simple key-value saving system into your game that you store along your other save data and then load on-...
Charanor's user avatar
  • 7,800
11 votes
Accepted

How can I create a six sided tillable perlin noise image?

I don't recommend using the "increase the dimensions and orbit in a cylinder" trick here. It has several disadvantages: More expensive to compute: Perlin noise needs to select and ...
DMGregory's user avatar
  • 132k
4 votes
Accepted

Is it cheaper to let each tile have its own collision?

Depending on how collision is implemented, the per-tile boxes may actually be more efficient (in case the bodies are in a Quad Tree most of them are easily discarded, but in the second case it may ...
Thorbjørn Lindeijer's user avatar
4 votes
Accepted

Drawing object lines in the Tiled map editor

Tiled does support drawing lines as collision objects. To do this, you should just not close the polygon (right-click once you're done with the polyline). In the past these have been separate tools, ...
Thorbjørn Lindeijer's user avatar
3 votes

How to use 16/32 square pixel tiles in tilemap on arbitrarily sized canvas in Phaser

The usual workflow with tilemaps in Phaser is this: You make a tile map, probably in a map editor like Tiled, and export to a format that Phaser can support, like JSON. Load the tile map in Phaser. ...
congusbongus's user avatar
  • 14.8k
3 votes

Tiled height level collision

Instead of defining a tile-type as "blocked" or "walkable" in general, define the four edges of a tile as "blocked" or "walkable" separately (a completely impassable tile would have all edges as "...
Philipp's user avatar
  • 118k
3 votes
Accepted

Tiled height level collision

In Tiled you can add layers. Use a layer for the ground level, elevation1, elevation2 etc. Define a ladder/stairs tile with a property (in the tileset tile property) to indicate the player can move ...
Felsir's user avatar
  • 4,057
3 votes
Accepted

How to extract a point in LibGdx from Tiled map?

Actually points in LibGDX are treated as RectangleMapObject with height=0.0 and width=0.0. Below debbuger output of object that is point on the tiled side:
iwek's user avatar
  • 166
2 votes
Accepted

How to use Tiled Editor to recreate a 2D map?

About resizing, as @bornander commented, there's a menu action for resizing that you need to use rather than directly changing the size in the Properties view. The following article is about ...
Thorbjørn Lindeijer's user avatar
2 votes
Accepted

How to integrate Tiled maps and collision detection with pygame?

Since no other solution to this question has been posted - and I now know a solution - I figured I would answer my own question so it may be useful for others. Consider the Tiled map that looks like ...
James's user avatar
  • 183
2 votes

How do I properly load maps?

This is a common problem caused by using floating point numbers for your camera movement. Occasionally, you will see the spaces between tiles. There are two ways you can counteract this: Round your ...
driima's user avatar
  • 995
2 votes
Accepted

How should I manage Roguelike levels/maps in JavaScript?

I see nothing fundamentally wrong with your approach. Just a few thoughts: Map is a pre-existing javascript data type. So unless the code in your answer actually ...
Christoph's user avatar
  • 241
2 votes
Accepted

Texture appearing blurry

Select the texture you have imported in the Project tab, and then in the Inspector, set ...
Engineer's user avatar
  • 29.4k
2 votes

Take an image and cut it up into a tile map

Take a look at Tiled. It's a tool for creating 2D tile maps including hex-based maps like the example in your post. Phaser allows you to load tile map data generated by this tool. Once you've created ...
JRR's user avatar
  • 21
2 votes
Accepted

How do you use these kind of rpg ground tileset ?

This tileset is famous because it was used in RPG maker VX. It seemingly consists of 6 tiles (2 by 3) and it even outputs tiles in that size, but it actually handles the tileset as if it was 4 by 6: ...
Bálint's user avatar
  • 14.8k
2 votes

Segmentation Fault using Allegro_Tiled, function al_open_map();

Looks like you are not initializing the library with al_init call. It tries to retrieve some standard directory to know where is the map stored, but crashes ...
michalsrb's user avatar
  • 166
2 votes
Accepted

Tiled tmx format into 3d Texture

You can create a mesh programmatically that corresponds to a tmx tilemap. A tilemap consists out of two things: the tilemap and the texture. I know the TMX format is not immediate in X,Y coordinates,...
Felsir's user avatar
  • 4,057
2 votes
Accepted

Finding equivalent axial coordinates for a wrapping hexagonal map of radius n

I figured it out. For anyone else in the future I followed the posts by Sander Evers that amitp suggested (thanks both of you), just the small_to_big and center_of functions in combination will give ...
Knackname's user avatar
  • 103
2 votes
Accepted

Tiled Map Editor Vs Text File? | Pygame

My suggestion would be to do both: Start by just following the tutorials and using the text file. This will give you a nice way of getting your head around what's going on in the code, and how you ...
Phil S's user avatar
  • 311
1 vote
Accepted

Assets from Tiled background layer not appearing in Cocos2d-x

Thanks to Thorbjørn Lindeijer for the answer! The problem, as he advised, was that cocos2d-x only allows one tileset per layer - separating the background into layers solved the problem. Updated ...
Kevin Mack's user avatar
1 vote

Can't get reliable collision detection/response in Monogame

Of-course it bounces. You are doing this: Detect rectangle intersection using Monogame API calls (this only tells you that an intersection occurred) Make the player going back/forward by the tile ...
Hatoru Hansou's user avatar
1 vote

Box2d collision on isometric maps built in Tiled

Finally figured out a way to do it. I convert the verticies of the box2d poly from orthagraphic to isometric. I edited the method from above to look like this. (The +320 and +175 to the co-ordinates ...
Bobby's user avatar
  • 131
1 vote
Accepted

How do you define walkable and unwalkable areas in Tiled?

A common method is to have one special "Collison" layer. This is a layer which you don't draw in the game but which you use to place special tiles which say which parts of the map are walkable. ...
Philipp's user avatar
  • 118k
1 vote

How do I properly load maps?

I face this problem often. That annoying lines are there because when you import the tileset in Tiled you're selecting a wrong tile size. For example, you're saying Tiled that your tiles are 33x32 (...
Victor Buendía's user avatar
1 vote
Accepted

Love2D and 'Tiled' - Detect if player is over certain tile/Collision

Indexing a 2D array represented as a 1D array is done like this: index = x + y * width Where width is sometimes known as ...
congusbongus's user avatar
  • 14.8k
1 vote

How do I incorporate .tmx files into my game?

The easiest way to parse TMX files with Java is to use the libtiled library. It is licensed under 2-clause BSD, which means you can use it for anything as long as you give credit. But if you would ...
Philipp's user avatar
  • 118k
1 vote

How do I incorporate .tmx files into my game?

I'd suggest taking a look at the following classes from the LibGDX framework- TiledMap, TMXMapLoader and MapRenderer. I found a decent tutorial here with example code for reading in and rendering a ...
David Greaves's user avatar
1 vote
Accepted

Top down tile based game render order

When you want to have overlapping sprites in your game, you need to put them in a list which you sort by the coordinate of the lower edge of each sprite and then render them in that order. Further, ...
Philipp's user avatar
  • 118k
1 vote

Pathfinding: grid based map of irregular numbered tiles to mark connections

Instead of having Id numbers you can assign a cost value to each tile based on the state of the tile. For example : if tile has enemy then give it cost value of 10000 and if there's a loot box then ...
Ankit singh kushwah's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible