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 ChrisC

I'm not really following the documentation on animating background maps.

Is it possible for me to place a tile in Weltmeister as a placeholder for an animation, and then in my code define/animate it?

1 decade ago by Joncom

You might find this thread helpful.

Here's an example of how to flag certain tiles to be animated:
var water = new ig.AnimationSheet( 'media/water-animation.png', 16, 16 );
var flower = new ig.AnimationSheet( 'media/flower-animation.png', 16, 16 );
var smoke = new ig.AnimationSheet( 'media/smoke-animation.png', 16, 16 );
ig.game.backgroundAnims = { 'media/map-tilesheet.png': {
      25: new ig.Animation( water, 0.15, [1,1,3,1,1,1,1,2] ) ,
      34: new ig.Animation( flower, 0.15, [1,1,2,2,1,1,2,4,3] ) ,
      11: new ig.Animation( smoke, 0.25, [3,4,3,4,5,6,5,6] ) 
} };

Assuming that the level you made uses the tilesheet "map-tilesheet.png", then tiles 25, 34, and 11 will be animated.

1 decade ago by ChrisC

I do follow that, I guess what I'm wondering is if its possible to place those animations using Weltmeister, rather than entering in tile numbers manually in the code. So a visual way to place them, rather than looking up the tile # in Weltmeister, placing the tile via code, and not seeing it in the level editor (even if you only see frame one in Weltmeister where they reside that would be useful).

1 decade ago by Joncom

As far as I know, this is the only way to do it.

1 decade ago by ChrisC

I tried creating an actual entity with an animation, that just stayed put and didn't do anything.. I could then place them in Weltmeister, but I couldn't figure out how to stop the items from falling to the floor (I tried to make some wall torches). I tried removing their gravity but that didn't work.

1 decade ago by Joncom

Removing their gravity should prevent them from falling.
Entity. gravityFactor should be set to 0.
If they still fall, maybe you're applying a positive y-velocity somewhere in your code.
Page 1 of 1
« first « previous next › last »