|
First off, you'll need three values for your character's left/right movement.
XBaseMov XModMove XTrueMov
The character's X position is offset every loop by XTrueMov, which is XBaseMov and XModMove added together.
When the character is on a platform or being blown around by the wind, simply set XModMove accordingly. (ie a platform heading right 2 pixels a second with no wind sets XModMove to 2)
XBaseMov is changed by holding left or right.
If this makes sense, you should be able to easily convert this to take moving platforms' Y movements into consideration as well.
EDIT: **** it let me explain that
When the character jumps, their Y offset is set to whatever their jumping power normally is, plus YModMove. YModMove is zero on flat ground and is modified by updrafts and platforms going up or down.
This post has been edited by Draco Icebane on Jan 27 2006, 06:43 PM
|