|
Simple Platform Movement ExampleLibrary file: GML This uses the following script in the End Step event:
The script checks that a move will not cause a collision with solid. If the position does overlap a solid then it first moves the object as far as possible horizontally, then as far as possible vertically. The rest of the object's code should be self explanatory. The sprite selection code uses an array to quickly select the appropriate sprite. The left and right events are relatively complex, but only to prevent the player "moonwalking" when facing a wall, and to make the player less able to change direction while jumping.
|