indexing description: "[ An EM_GOOF_OBJECT that is movable. ]" date: "$Date$" revision: "$Revision$" class EM_GOOF_MOVABLE inherit EM_GOOF_OBJECT redefine process, make end create make feature -- Initialization make(img: EM_BITMAP x: DOUBLE y: DOUBLE phs: EM_GOOF_PHYSICS) is -- Make movable do create movement.make(0,0) Precursor(img,x,y,phs) end feature {EM_GOOF_OBJECT, EM_GOOF_PHYSICS, EM_GOOF_FORCE, EM_GOOF_LOADER_NODE_PROCESSOR, EM_GOOF_LEVEL_SCENE} -- Properties movement: EM_VECTOR_2D -- Current movement last_position: EM_VECTOR_2D -- Where was it last frame(internal)? feature {EM_GOOF_OBJECT, EM_GOOF_PHYSICS} -- Processing process(time_length: DOUBLE) is -- process this object local time_movement: EM_VECTOR_2D do last_position := position.twin time_movement := movement.twin time_movement.stretch(time_length, time_length) position.add(time_movement) Precursor(time_length) end invariant -- TODO: Not satisfied when 'premake' is used (e.g. in EM_GOOF_BALL)! -- has_movement: movement /= void end