Thanks to this excellent tutorial(https://nluqo.github.io/broughlike-tutorial/index.html) about creating a roguelike game, made by Jeremiah Reid (https://twitter.com/humbit), I was able to convert the original code from javascript to PureBasic. And with some CompilerIf's the game now run on the browser, thanks to SpiderBasic. Here is a look:

The game and source code are available here:
https://ricardo-sdl.itch.io/roguelikelike