L
L
lotrop2016-09-20 09:01:23
JavaScript
lotrop, 2016-09-20 09:01:23

How to animate a complex sprite?

I'm making a game and when animating a sprite, in which each frame has the same height and width, everything turns out fine.
But what to do if the frame in the sprite has a different height and width from the previous one. Specify how or in an array these parameters for each frame? What would be the best way to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ildar Gizetdinov, 2016-09-20
@lotrop

yes, you will have to store the height and width because all animations will read the same size, or you can base the largest animation and use its width and height as a common one for all.
Minus: for example, when you click, the wrong place can be processed, since formally you clicked where that animation has nothing

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question