Jump to content

Maximum call stack size exceeded


glass22
 Share

Recommended Posts

Hi,

 

I'm trying to load a bunch of sprites on screen, then update them but am getting the error Maximum call stack size exceeded

 

I've made it as simple as possible and still get the error

 

function update()
{
        badGuyArray[0].update();
}

 

    obj.update = function()
    {
    };

 

even with this it's still occuring
   

 

Link to comment
Share on other sites

Hi,

 

Obj.update is just a function attached to my badguyObject, the object is created as obj, then returned to a createBadGuy function as a value.

 

var BadGuy = function()
{
    var current = baddies.create(game.world.randomX, game.world.randomY, "bad");
    var obj = SpriteBase(badSpeed, badHits, current);

   
    obj.update = function()
    {
      //var move = accelerateToObject(this.unit, Player.unit, this.speed, this.speed * 2, this.speed * 2);
    };
   
    badGuyArray.push(this);
    return obj;
};

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...