1 decade ago by Joncom
I have a tile in my map which has an animation:
My map have two layers:
- one is above the player and is called "above"
- the other is below the player and is called "below"
I want do something like the following in ig.Animation's draw function:
And so my question is:
How can I find out what layer of the map the animation is in so that each instance of ig.Animation has this information?
var animationSheet = new ig.AnimationSheet('media/animation.png', 16, 16 ); ig.game.backgroundAnims = { 'media/tilesheet.png': { 7: new ig.Animation( animationSheet , 0.15, [1,2,3,4,5,6,7,8] ) } }
My map have two layers:
- one is above the player and is called "above"
- the other is below the player and is called "below"
I want do something like the following in ig.Animation's draw function:
ig.Animation.inject({ draw: function() { if( isInAboveLayer ) // do one thing else if( isInBelowLayer ) // do something else } }
And so my question is:
How can I find out what layer of the map the animation is in so that each instance of ig.Animation has this information?