diff --git a/code/CandyFucker.js b/code/CandyFucker.js index 4c3be53..92ab0ed 100644 --- a/code/CandyFucker.js +++ b/code/CandyFucker.js @@ -23,7 +23,7 @@ CandyEntity.prototype = { SetGridPosition: function(x, y){ this.GridPosition.X = x; this.GridPosition.Y = y; - this.GameEntity.SetPosition({ + this.GameEntity.UpdatePosition({ X: this.Game.GridOffset.X + (x * 32), Y: this.Game.GridOffset.Y + (y * 32) }); @@ -44,7 +44,8 @@ var CandyFucker = function(idScreen, idInfoDisplay){ this.GameScreen = new GameScreen(idScreen, this.Init.bind(this), this.Proc.bind(this), - this.End.bind(this) + this.End.bind(this), + 10 ); this.InfoDisplay = document.getElementById(idInfoDisplay); this.Grid = null; @@ -82,7 +83,7 @@ CandyFucker.prototype = { } }else{ if(this.ApplyRules()){ - this.Falling = true; + this.Falling = this.CandyFall(); }else{ this.Locked = false; } @@ -91,7 +92,7 @@ CandyFucker.prototype = { if(this.Changed){ if(this.ApplyRules()){ this.Locked = true; - this.Falling = true; + this.Falling = this.CandyFall(); } } } @@ -123,15 +124,23 @@ CandyFucker.prototype = { this.GridSize = {X: width, Y: height}; this.GridOffset.X = (this.GameScreen.Size.X - ((width - 1) * 32)) / 2.0; this.GridOffset.Y = (this.GameScreen.Size.Y - ((height - 1) * 32)) / 2.0; + // Allocate Grid this.Grid = []; for(y=0;y