PerlGameDev / SDL

Rehashing the old perl SDL binding on cpan.org
http://search.cpan.org/dist/SDL
GNU General Public License v2.0
81 stars 29 forks source link

SDLx::Sprite::Animated need random start frame #196

Open kthakore opened 13 years ago

kthakore commented 13 years ago

When I set many units on map they all move equally (in lockstep). Now just one possible code to do that:

after constructor

$anim->next for 0 .. rand 10;

but this is very ugly =(

I think we need add param in constructor: randomize => 1, and/or param/function to set start frame manually.

jtpalmer commented 13 years ago

I'd like the ability to change the frame manually (not just in the constructor). SDLx::Sprite::Animated::current_frame() returns the frame number, but I'd like to use that method to change the current frame as well.