I love it when code can be reused in ways you didn’t think of when writing it. These platforms are moving up and down controlled by an animation. I knew I’d need that ping pong looping mode for something!
For good measure, here’s a sample of the XML that defines the moving platform:
<XnaContent xmlns:Generic="System.Collections.Generic"> <Asset Type="Generic:List[Throng.MovingPlatformSettings]"> <Item> <Name>platform1</Name> <ModelName>platform1</ModelName> <Speed>1.5</Speed> <PathOffset>0</PathOffset> <Moving>true</Moving> <PingPong>true</PingPong> <Vertices>-1 -0.25 -1 0.25 1 0.25 1 -0.25</Vertices> <Path>-2 10 -2 2</Path> </Item> </Asset> </XnaContent>