Skip to content

HTML5 Guide

Pizzaandy edited this page Sep 4, 2021 · 2 revisions

The HTML export for GMS 2 sometimes behaves differently than Desktop exports. Your game does not need to run on the HTML export, but we encourage you to support it!

Shaders

Do declare vars in for init

Bad:

float i;
for(i = 0.0

Good:

for(float i = 0.0

Do not use non-constant expressions in loops

Bad:

for(float i = uniform_dynamic_var; i < uniform_dynamic_var2; i++)

Good:

for(float i = 0.0f; i < 100; i++){
    if(i >= uinform_dynamic_var_2){
      break;
    }
}
Clone this wiki locally