Skip to main content
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,870
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
  • 135k
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

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
  • 120k
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,067
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 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
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
  • 30k
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

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

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.9k
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,067
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

How do you use these kind of rpg ground tileset ?

These are "Auto Tiles" for the RPGMaker game engine. While the map editor uses 32x32 tiles as a basic logic unit, the engine actually splits the tiles into 16x16 tiles. The map editor then ...
Philipp's user avatar
  • 120k
1 vote
Accepted

Preloading for level transitions in a tile-based game?

What I would do (let's assume you have a game instance called GameStatus) is something similar to this:: Have a GameStatus.cached_map that can be either None or contain a TileMap object (created by ...
RobM's user avatar
  • 146
1 vote

Love2D STI library not drawing map at all (black screen)

I realized you need to be careful exporting lua maps from Tiled, because they are automatically named like "[your map name]..lua". I'm not sure why this is, but when I did Export As instead and named ...
Alexis Purslane's user avatar
1 vote

How to zoom in and out the full tilemap from center in phaser?

First you need to setup your camera like this: ...
Moe-Joe's user avatar
  • 111
1 vote

Phaser is not loading the same map created in Tiled software

At the very bottom of your json file, I see: "width":19 But when I count the tiles across your floorplan, I get 20. This off-by-one difference can create ...
DMGregory's user avatar
  • 135k
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
  • 120k
1 vote

Tiled object layer draw sprites

Please consider that the previous answer is not complete. If you render object with the 3 param batch.draw(...), the TextureMapObject would be rendered without the provided in the TileMap scale and ...
алекс кей's user avatar
1 vote

Box2D shape/fixture position vs. body position

The fixture position in box2d is in relation to the body position. So if you set your fixture to be at (5, 5) the body is still at (0, 0) and if you then move the body to (1, 0), the fixture will then ...
WingedRayeth'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
  • 120k

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