HaxeFlixel / flixel-docs

Documentation for HaxeFlixel
72 stars 135 forks source link

Tutorial Chapter 12 mentions setupGame function #187

Closed KosnIre closed 7 years ago

KosnIre commented 7 years ago

The Tutorial Chapter 12 Sound and Music mentions a function called setupGame.

we're going to make it start playing outside of our states when we setup our game. In the setupGame function, after our volume-setting code, add:

This function is not mentioned anywhere else in the Tutorial and I dont find it in the HaxeFlixel code either. I believe it was a helper function that was possibly used in a previous version of the Tutorial, but is no longer needed. Chapter 13 edits this same area of the code (see Step 4 there) and does not talk about a setupGame function there.

Gama11 commented 7 years ago

setupGame() used to be part of Main.hx of the template.

Gama11 commented 7 years ago

That doesn't match the source in flixel-demos though, the music starts playing in MenuState there...

KosnIre commented 7 years ago

Ok yes, a693b04 works quite nicely, and moving it to MenuState also fixes the issue where the music would play over the HaxeFlixel logo in a release build.

One more adjustment though—13 - Multiple Platforms says:

  1. Now that we have different versions of our music, we need to make sure we play the right version. In Main.hx, replace the line where we start playing our music with:

...where Main.hx now needs to be MenuState.hx.

Gama11 commented 7 years ago

Man, so easy for things to get out of sync. Thanks, fixed! :)

KosnIre commented 7 years ago

No problem, that's why it's nice to have multiple eyes on a project :)