DEV Community

Konrad Chmielecki
Konrad Chmielecki

Posted on

my experience with blazor

When I wrote my first project in this year, I don't even planed to used blazor. But my childlike curiosity directed me on that path.
I wanted to know, haw hard will be port game from desktop to web browser in .net. And I found out is not that hard.
But I have experience with similar tools before. I used gopherjs and emscripten.
Thanks to that I know what must to do, to communicate c# with javasrcipt.
I made working blazor port pretty fast. Not only server side but webassembly to.
Of curs create port for different platform always generate some problems.
Most weird problem I have in blazor is how floating point number behave.
I received in some cases NaN values. This problem I resolve adding value like 0.0001 in calculation.

Blazor server work differently then wasm. But I don't expected that server version will be cause game to flickering.

game flickering

This is happen when server don't have enough cpu power.

Now when I know pros and cons of blazor for creating game, I start thinking about next game.
But I focus only on wasm version and smartphones. This will be challenge, I do not doubt that.
Maybe blazor is not perfect tool for this task. But I see some potential, and is nice to use c# in web browser.

Top comments (0)