Tracked down an evil bug in Group.swap that caused the linked list to get corrupted in an upward (B to A) neighbour swap.

This commit is contained in:
photonstorm
2013-11-06 16:46:21 +00:00
parent 8b793cd8d7
commit dfb22f1044
8 changed files with 496 additions and 131 deletions
@@ -17,12 +17,13 @@ BasicGame.Preloader.prototype = {
this.background = this.add.sprite(0, 0, 'preloaderBackground');
this.preloadBar = this.add.sprite(300, 400, 'preloaderBar');
// This sets the preloadBar sprite as a loader sprite, basically
// what that does is automatically crop the sprite from 0 to full-width
// This sets the preloadBar sprite as a loader sprite.
// What that does is automatically crop the sprite from 0 to full-width
// as the files below are loaded in.
this.load.setPreloadSprite(this.preloadBar);
// Here we load most of the assets our game needs
// Here we load the rest of the assets our game needs.
// As this is just a Project Template I've not provided these assets, swap them for your own.
this.load.image('titlepage', 'images/title.jpg');
this.load.atlas('playButton', 'images/play_button.png', 'images/play_button.json');
this.load.audio('titleMusic', ['audio/main_menu.mp3']);
@@ -33,7 +34,7 @@ BasicGame.Preloader.prototype = {
create: function () {
// Once the load has finished we disable the crop because we're going to sit in the update loop for a short while
// Once the load has finished we disable the crop because we're going to sit in the update loop for a short while as the music decodes
this.preloadBar.cropEnabled = false;
},
@@ -51,7 +52,7 @@ BasicGame.Preloader.prototype = {
if (this.cache.isSoundDecoded('titleMusic') && this.ready == false)
{
this.ready = false;
this.ready = true;
this.game.state.start('MainMenu');
}