I want to be able to run or not run code depending on which platform I am building for. Some code should only run for the HTML5 platform. How can I find out whether the platform being run is HTML5 inside my gamemaker events?


You can check what browser the game is currently being run in with the os_browser constant. If the game is not being run in a browser the constant will be browser_not_a_browser. So to check if it is being run in a browser simply do:

if os_browser != browser_not_a_browser {
     // Being run in a browser
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.