/* Trampoline */
-Sprite *img_trampoline[TRAMPOLINE_FRAMES];
+Sprite *img_trampoline;
Trampoline::Trampoline(LispReader& reader)
{
void
Trampoline::draw(DrawingContext& context)
{
- img_trampoline[frame]->draw(context, base, LAYER_OBJECTS);
+ img_trampoline->set_frame(frame);
+ img_trampoline->draw(context, base, LAYER_OBJECTS);
frame = 0;
}
void load_object_gfx()
{
- char sprite_name[16];
-
- for (int i = 0; i < TRAMPOLINE_FRAMES; i++)
- {
- sprintf(sprite_name, "trampoline-%i", i+1);
- img_trampoline[i] = sprite_manager->load(sprite_name);
- }
-
+ img_trampoline = sprite_manager->load("trampoline");
img_flying_platform = sprite_manager->load("flying_platform");
-
img_smoke_cloud = sprite_manager->load("stomp");
}
Timer timer;
};
-#define TRAMPOLINE_FRAMES 4
-extern Sprite *img_trampoline[TRAMPOLINE_FRAMES];
+extern Sprite *img_trampoline;
class Trampoline : public MovingObject, public Serializable
{