indexing description: "[ Example of how to implement a predefined creation procedure for a EM_SPRITE_COMPOSITION ]" date: "$Date$" revision: "$Revision$" class TRAFFIC_LIGHT inherit EM_SPRITE_COMPOSITION create make_light feature -- Initialization make_light is -- creates a composition of EM_SPRITEs local sprite1, sprite2, sprite3: EM_SPRITE black, green, orange, red: EM_DRAWABLE do -- create images bitmap_factory.create_bitmap_from_image ("black.png") black := bitmap_factory.last_bitmap bitmap_factory.create_bitmap_from_image ("green.png") green := bitmap_factory.last_bitmap bitmap_factory.create_bitmap_from_image ("orange.png") orange := bitmap_factory.last_bitmap bitmap_factory.create_bitmap_from_image ("red.png") red := bitmap_factory.last_bitmap -- create all sprites create sprite1.make ("black.png", 1000, 0, 0) sprite1.extend ("red.png", 3000) create sprite2.make ("black.png", 2000, 60, 0) sprite2.extend ("orange.png", 2000) create sprite3.make ("black.png", 3000, 120, 0) sprite3.extend ("green.png", 1000) -- put all sprites together make_composition (sprite1, 100, 200) force (sprite2) force (sprite3) end end