casey Posted March 22, 2018 Share Posted March 22, 2018 Just going through the P3 tutorial "Making your first Phaser 3 game". I realized that "bombs" is not declared first as a variable, unlike "platforms", "player", etc. It functions with or without the declaration, so when is it necessary to declare the variable ahead of its first use? Link to comment Share on other sites More sharing options...
rich Posted March 22, 2018 Share Posted March 22, 2018 If you forget to declare it, it just becomes a globally scoped var. which is why it works either way (in this tutorial) casey 1 Link to comment Share on other sites More sharing options...
Recommended Posts