1 decade ago by Heartless49
I've never really dabbled in backgroundAnims, and I've read all of the documentation/forum posts that I could, trying to learn how to do it correctly, but even then no matter what I try it just doesn't seem to want to work...
I'm just trying to animate the water on my map, and the tiles for the animation are on the same tilesheet that the tile-to-be-animated is on... not sure if that could be the reason, but no matter how I try doing it, it just doesn't want to animate.
That's the code that I've got set to run RIGHT inside of my init method, and I really can't figure this out.
II am trying to animate tile number 6, from the tilesheet - and I know it's the right tile number - but it just wont do anything. I'm not sure if there's something I'm supposed to be calling in my update/draw functions, or if I'm calling something wrong, but in the console, when I call ig.game.backgroundAnims, it lists that animation, and if I call it repeatedly, I can see that it IS animating, but on the actual map itself, I see nothing...
init: function() { var water = new ig.AnimationSheet( 'media/graphics/environment/water.png', 32, 32 ); this.backgroundAnims = { 'media/graphics/environment/water.png': { 6: new ig.Animation( water, 0.5, [6,8,6,12] ), } }; this.loadLevel(LevelDungeon);
I'm just trying to animate the water on my map, and the tiles for the animation are on the same tilesheet that the tile-to-be-animated is on... not sure if that could be the reason, but no matter how I try doing it, it just doesn't want to animate.
That's the code that I've got set to run RIGHT inside of my init method, and I really can't figure this out.
II am trying to animate tile number 6, from the tilesheet - and I know it's the right tile number - but it just wont do anything. I'm not sure if there's something I'm supposed to be calling in my update/draw functions, or if I'm calling something wrong, but in the console, when I call ig.game.backgroundAnims, it lists that animation, and if I call it repeatedly, I can see that it IS animating, but on the actual map itself, I see nothing...