HellRok / Taylor

A simple game engine built using raylib and mruby
https://www.taylormadetech.dev
MIT License
97 stars 6 forks source link

Platformer and Gestures examples in Taylor Playground won't run #13

Closed Chadowo closed 1 year ago

Chadowo commented 1 year ago

As the title says, The platformer and Gestures example can't run on the playground, I'm using Firefox 111 on linux, taking a look on the dev console reveals this error Uncaught (in promise) Please compile your program with async support in order to use asynchronous operations like emscripten_sleep

After looking on the source code for the platformer example it seemed like there was a chunk of code missing required for running in web as stated in the cheatsheet, so I did the next changes to the platformer source code

# Was until window_should_close?
def main
  # do game stuff...
end

# Added this before close_window
if browser?
  set_main_loop 'main'
end

doing that, however gave me this error Uncaught Infinity Taylor Playground.js:225:3 I'm not sure if I'm missing something or not, help is sure appreciated!

HellRok commented 1 year ago

Thank you for bringing this to my attention, I apparently missed updating these when I was doing a migration away from ASYNCIFY in emscripten. I have tested all the examples and confirmed they now all work.