+void
+Sprite::draw_part(float sx, float sy, float x, float y, float w, float h)
+{
+ time = SDL_GetTicks();
+ unsigned int frame = get_current_frame();
+
+ if (frame < surfaces.size())
+ surfaces[frame]->draw_part(sx, sy, x - x_hotspot, y - y_hotspot, w, h);
+}
+
+void
+Sprite::reset()
+{
+ time = 0;
+}
+
+int
+Sprite::get_current_frame() const
+{
+ unsigned int frame = static_cast<int>(fmodf(time, surfaces.size()*frame_delay)/frame_delay);
+ return frame % surfaces.size();
+}
+
+int
+Sprite::get_width() const
+{
+ return surfaces[get_current_frame()]->w;
+}
+
+int
+Sprite::get_height() const
+{
+ return surfaces[get_current_frame()]->h;
+}
+