Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by ahackit

this.currentAnim = this.anims.rWest;


For some reason I can't get my animation to work. I am pretty sure I have nailed it down to here. Its not finding the .anims part of that function. Any words of advice.

1 decade ago by Joncom

Any errors in your console?

1 decade ago by drhayes

Can you post more context around the code that&039;s failing? Is this in a particular method (I know it's probably #init, but just checking).

1 decade ago by ahackit

@Joncom I am using PHPStorm, and really new to this so I don't know how to pull up an error console.

@DrHayes I am assuming you are just wanting to see the Animation related statements in Init

animSheet : new ig.AnimationSheet('media/sprites7050.png',70,50),

init: function(x,y,settings){
this.parent(x,y,settings);
this.addAnim('rSouth',1,[0,1,2,3]);
this.addAnim('rSoutheast',1,[4,5,6,7]);
this.addAnim('rEast',1,[8,9,10,11]);
this.addAnim('rNorthEast',1,[12,13,14,15]);
this.addAnim('rNorth',1,[16,17,18,19]);
this.addAnim('rNorthWest',1,[20,21,22,23]);
this.addAnim('rWest',1,[24,25,26,27]);
this.addAnim('rSouthwest',1,[28,29,30,31]);
},

1 decade ago by tunglxx226

@ahackit: to pull up the error console, in Google Chrome you press Ctrl + Shift + J. In other browsers, look in Tools, Debug Tool or something like that :D

1 decade ago by drhayes

On a Mac, it's Command (⌘)+Option+J.

Cool, thanks for the context. That looks fine. What about the code around this.anims.rWest?

I&039;m wondering if you're calling your code in some context where #this isn't the Entity; it's something else. JavaScript is funny that way.
Page 1 of 1
« first « previous next › last »