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 Hazneliel

Hello, is there a way to make an animation where the entity just updates a few pixels of its sprite?
Or is there a way for an entity to have 2 sets of sprites one over the other like the foreground layer example, and set the animations for those sprites?

For example, a car is animated when its runing, this layer has the drawing of the car and the color of the car is being animated by another layer with only the color.

That way I only have to change the color layer while not changing the first one animating the car running.

1 decade ago by Hareesun

You could cheat a little and have a separate entity called EntityCarColor that nests inside EntityCar. Then have the color spawn when you need it too. OR, just have a multiple state - multiple color spritesheet and have the car switch animation when needed.

The latter's the better idea I think. :P

1 decade ago by stahlmanDesign

In the same vein, is it possible to have colour transform effects with HTML/Canvas? It would be nice to apply a colour tint to a player to turn the whole sprite a shade of red for a moment when damage is applied, instead of having to use a separate sprite sheet.

1 decade ago by Hareesun

This is totally possible, I just can't remember how I did it. You may find an extra spriteHurt state works better though.

1 decade ago by Hazneliel

Thanks for the help, I may try it but maybe I should use extra sprites
Page 1 of 1
« first « previous next › last »