1 decade ago by MarkJohnson
Ok so I have a variable
But somehow the variable fireDir is not making it through to the constructor, because when I reference it, It says it is undefined. Could someone please tell me how to properly pass variable through to the constructor?
Thanks,
Mark Johnson
fireDir
which is an associative array. I'm trying to pass it to a class which extends ig.Entity.ig.game.spawnEntity( this.activeWeapon, this.pos.x, this.pos.y+20, {flip:this.flip}, fireDir); EntityPistolBullet = ig.Entity.extend({ //Differant properties init: function(x, y, settings, fireDir) { this.parent(x + (settings.flip ? -4 : 8), y+8, settings); theGame = ig.game.getEntityByName("MyGame"); this.vel.x = this.accel.x = this.maxVel.x * theGame.BulletFireDir.x; this.vel.y = this.accel.y = this.maxVel.y * theGame.BulletFireDir.y; this.addAnim('idle', 0.2, [0]); },
But somehow the variable fireDir is not making it through to the constructor, because when I reference it, It says it is undefined. Could someone please tell me how to properly pass variable through to the constructor?
Thanks,
Mark Johnson