Load wall tiles from tilemap as custom sprite

I am a student transitioning from Unity to Haxeflixel. I am trying to load a tilemap from Ogmo Editor for a Sokoban game. The tiles will have a custom class derived from FlxSprite that has extended functionalities needed for the game. The problem is, I can’t find a way to convert them to custom sprites.

I am aware of the loadEntities method from the FlxOgmoLoader class. From my point of understanding, this method gets all “entity markers” from the json level file and then calls a custom function that proceeds to add sprites based on the marker’s type. But this only works for entity layers, and my wall layer is a tile layer.

I have found a method of the FlxTilemap class called tileToSprite on the Haxeflixel documentation, and it seems to fit with my requirements, but I just began with Haxe and I don’t understand much. One of its parameters is a FlxTileProperties object, but the documentation is sparse and didn’t help with my problem. I tried googling for tutorials and resources but found none.

Unity has many resources online, so I’m not used to the lack of resources and documentation. Thus my last resort is to get help from the Haxe community. If all else fails, I will make my walls as entities inside of Ogmo Editor, and then implement the loadEntities method, although this approach is not preferred since it would lead to conflicts in the code.

To summarise, I am finding answers to the questions below:

  1. How does tileToSprite work, and will it solve my problem?
  2. If it doesn’t, is there any other approach to get what I need?

Help is appreciated. Please ask if any questions arise. I will be happy to answer.

I am a new user, and the forum doesn’t let me put more than two links in a post. Here is the link to the documentation for FlxTileProperties.

https://api.haxeflixel.com/flixel/tile/FlxTileProperties.html

Hello, I am curious what made you transition from Unity to Haxeflixel?

I was tired of Unity’s clunky UI because it was hard to organise GameObjects, animate, et cetera. I would have a few dozen folders in the workspace and was constantly expanding and collapsing folders to navigate to the right object.

When I stumbled upon Haxeflixel I was impressed that it was UI-less and completely code-based, which meant that I could organise sprites directly in my code, without any UI hassle.

I felt very obstructed by Unity’s UI and thought that it was very inefficient, thus I decided that it was time for a switch.

Overall, I am very impressed with Haxeflixel and how quick it was to cook things up. There are some handy functions such as the camera effects that Unity didn’t offer. A clear downside though is the lack of resources and tutorials. But I guess that’s what forums are for :man_shrugging:

Will you get more useful information here

1 Like

Thanks! I didn’t know that there was a seperate forum for Haxeflixel! I’ll try to ask for help there.