Static turn-based 2d tiled display in Xamarin Forms game

Hi, I'm just wondering what would be a suitable way for displaying a 'map' kind of thing, based on small 2d bitmap tiles? The game I'm writing is a simple. almost turn-based thing, there are no sprites, animations or time-critical user interactions etc.

Right now I have a long, multi-line label (using a monospaced font) to display a 'map' using different letters for different elements on the map. This was fine for developing and testing the game logic. Now I want to transform this into a graphic, and one way to do it would be to use a grid with columns and rows but I'm not sure how performant that might be (my map would be 25 columns and 19 rows).

I glanced at CocosSharp2d and wondered if that might be better suited for tile-based displays. My grid would contain 475 little bitmaps (mostly repeating, there are about a dozen unique tiles I need) and it will be shown inside a StackPanel that has buttons and other labels. Anyone done this kind of thing before and can advise a good approach? I'm in the latest Xamarin Forms, and the title is intended for iOS and Android, phone and tablet form factors. On the smaller screens the bitmaps would be simple symbols but where there is more screen estate it would be nice to have more detailed symbols or images.

Any suggestions? Thanks!

Tagged:

Answers

  • JoeBonavitaJoeBonavita USMember ✭✭

    This sounds to me like you don't need a gaming engine at all. Wouldn't a Grid do what you need?

  • RobsoftRobsoft GBMember ✭✭

    @JoeBonavita said:
    This sounds to me like you don't need a gaming engine at all. Wouldn't a Grid do what you need?

    I don't know to be honest - I had to park it at the time for other real-life projects that came up, but I'd like to get back to it soon. I've never tried using the grid for anything like that kind of number of items. I was thinking some kind of tiled graphic approach might enable me to scroll around the map, I don't know what the tools are like for scrolling a grid. It's not an action game or anything like that, so I guess that manually controlling and updating the grid elements that you can see to giev the impression of you seeing a window on a bigger area could work. I'll do a bit of playing around and see how performant it might be :-)

    Thanks for the reply!

Sign In or Register to comment.