1 decade ago by Joncom
I managed to animate some map tiles using the following code in the init() function of main.js:
The problem is, I want to replace tile 4 from any map using tilesheet: 'media/start-towna.png' and instead use an animation from 'bg-flower.png'. Is this possible?
[edit] This page says:
I'm just curious how.
[edit2] Nevermind I figured it out. It just took changing the first line of my code:
Derp.
// set up animated map tiles var as = new ig.AnimationSheet( 'media/starter-towna.png', 16, 16 ); this.backgroundAnims = { 'media/starter-towna.png': { 4: new ig.Animation( as, 0.2, [0,1,2,3,4,5,6,7,8,9] ) } }; this.loadLevel (LevelTown);
The problem is, I want to replace tile 4 from any map using tilesheet: 'media/start-towna.png' and instead use an animation from 'bg-flower.png'. Is this possible?
[edit] This page says:
The image used for the AnimationSheet can be different from the one used as the tileset for the BackgroundMap
I'm just curious how.
[edit2] Nevermind I figured it out. It just took changing the first line of my code:
var as = new ig.AnimationSheet( 'media/bg-flower.png', 16, 16 );
Derp.