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
@@ -10,7 +10,7 @@ BasicGame.MainMenu.prototype = {
create: function () {
// We've already preloaded our assets, so let's kick right into the Main Menu itself
// We've already preloaded our assets, so let's kick right into the Main Menu itself.
// Here all we're doing is playing some music and adding a picture and button
// Naturally I expect you to do something significantly better :)
@@ -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');
}
+2 -1
View File
@@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8" />
<title>Phaser Basic Project Template</title>
<script src="phaser.min.js"></script>
<script src="Boot.js"></script>
<script src="Preloader.js"></script>
<script src="MainMenu.js"></script>
@@ -17,7 +18,7 @@
window.onload = function() {
// Create your Phaser game and inject it into the gameContainer div.
// We did it in a window.onload event, but you can do it anywhere (requireJS load, anonymous function, jQuery dom ready, etc - whatever floats your boat)
// We did it in a window.onload event, but you can do it anywhere (requireJS load, anonymous function, jQuery dom ready, - whatever floats your boat)
var game = new Phaser.Game(1024, 768, Phaser.AUTO, 'gameContainer');
// Add the States your game has.