[JavaScript] Desert levels code samples don't declare variables properly


#1

The variables x and y are used without the keyword “var”. This is bad practice and should not be encouraged by the sample codes.


#2

Thanks for noticing that.

Sadly this sometimes slips through, but luckily there is one person that can help:

#YOU

Yes, we need you! Quickly jump to the level-editor and fix the sample-code yourself! Propose it today as a patch and get a free achievement! (I’m actually not sure on the achievement-part…)


Back to serious, try to get yourself familiar with the level-editor. Not only can you fix problems like these but also create your own awesome-levels.

You just need to be logged in to the CC-Page, select the level with the wrong sample-code and select the Hero-Placeholder to change the sample-code. Sadly you didn’t tell us which level has the bad code so we can’t fix it our-self.


#3

Ok, I submitted the changes on the levels I played so far. I will keep an eye to other problems.

Thanks.


#4

OK, addition of “var” to default js code for Medical Attention, Sarven Road, and Oasis accepted. Thanks!