Nearoo / Wario-Land-3

A remake of the GBC-Game "Wario Land 3" using Pygame for Python
MIT License
51 stars 13 forks source link

Improve Animation-Class #1

Closed Nearoo closed 9 years ago

Nearoo commented 9 years ago

The animation-class is still very limited. It would be great to be able to control the order of sprites much more.

One improvement would be to separate the information about the order of the sprites from the actual surfaces. One argument could be the list of all the surfaces, and another one the order in which these surfaces should appear - which could be much longer than the amount of surfaces given. To combine it with the length of the single sprites, a list could look like this:

[(frame_nr_1, frame_1_length), (frame_nr_2, frame_2_length) ...]

An animation that plays its surfaces in order 1, 2, 1, 3, 1, 2, 1, 3 with each frame being showed 100 frames would then look like this:

Animation(self, [surface_1, surface_2, surface_3], [(0, 100), (1, 100), (0, 100), (2, 100)])