|
Platforms with curved surfacesThe ramp code does not allow for the player sliding down steep slopes. Also I wanted to implement curved platforms in a style reminiscent of the Sonic-the-hedgehog games. This code expands on the ramp code with two major additions: I have added a collision event. This event uses the bounce function to obtain information about the angle of a surface.
Also note that the bounce function appears to work best when an object is moving relatively fast. The information gained from the move_bounce_solid() command is used to make the player bounce off of steep slopes just enough that they appear to slide instead of being able to stand on single-pixel ledges. The ramp_platform code has been modified, the code in the freefall section setting hspeed and vspeed to zero has been commented out. The speed is set by the collision code, zeroing it here as well would cause erratic results. A whole new movement mode has been added for when the player is running. Special code is added to the left, right and jump actions. EXE: curve_platform.zip GMD: curve_platform.gmd Footnote: Feel free to use this. |