0
\$\begingroup\$

So I am attemping to make a game in Phaser.

I am trying to think of the best way to cut this image up and make it in to a tile map OR do I try and lay this entire image as a back ground to the game and just determine where the mouse was clicked.

I believe the images have a width of 140 and a height of 160 or 162. Then I would have to make the four corners of the image transparent so I can overlay them to create the map.

If I want to go with a scrollable background, I am not sure how to proceed, would I overlay hot spots on to the screen and would I have to do a point to hex conversion as I would not have the tile coordinates

enter image description here

\$\endgroup\$
  • 1
    \$\begingroup\$ Hi Mike. That map appears to belong to Dwarfstar Games (or one of their collaborators) for the tabletop game Barbarian Prince. Is it released under a license that allows you to use it? We cannot condone or assist in illegal activities such as copyright violation, since that compromises our site's integrity. We cannot advise you on that particular map, but we can advise on chopping up hexagonal maps on principle. In this scenario, I suggest you find a hexagonal map you do have license to use for an example. \$\endgroup\$ – doppelgreener Jul 22 '17 at 20:11
  • \$\begingroup\$ Sure.. this was more of a programming practice exercise that I wanted to build a tool for my self. I never intended to release or resell the final product. from the website PLEASE NOTE: These games and files are NOT released into the public domain. You MAY NOT not sell these files or charge a fee for access to them. You MAY NOT distribute these files except as authorized by Reaper Miniatures. PLEASE RESPECT THE TERMS OF THE DISTRIBUTION AGREEMENT so that these files can remain available for free download. \$\endgroup\$ – Mike Jul 22 '17 at 20:47
  • \$\begingroup\$ Also if you were going to chop up a map into hexagon tiles, are there tools you would recommend and is there a program like tiled that works with "flat top" hexagonal maps \$\endgroup\$ – Mike Jul 23 '17 at 0:44
1
\$\begingroup\$

Take a look at TILED. http://www.mapeditor.org/ 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 and exported your map you would do something like this in your preload script:
this.game.load.tilemap('SweetTileMap', '/images/maps/sweetMap.json', null, Phaser.Tilemap.TILED_JSON); this.game.load.image('tiles', '/images/terrain_atlas.png');

Then use it as you would use any other tile map in Phaser. There's a basic tutorial here: http://brandonclapp.com/creating-and-importing-a-map-for-phaser-using-tiled/

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.