|
A new approach to Gamemaker Platform gamesPlatform games are popular, and there seems to be no shortage of platform "engines", however I was unable to locate one with the exact feature set I wanted. Also having found an engine it is usually impractical to drop it into a game as it requires special actions in several events. What is needed is a "Move_Platform" command that would automatically make an object fall until it landed on something solid. To achieve this I propose adding a script to the "End Step" event, after collisions but just before drawing takes place. The code will replace the standard behaviour with "move_contact" actions that will make the object free fall normally, "land" on solid objects and further to this it will follow ramps of up to 45 degrees up or down. It will be up to the developer to add keyboard actions, set a gravity, friction, select sprites etc. As the keyboard handling is separated from the engine it is easy to create "monsters" under computer control. Also the code requires a flag called "jump" which should be set in the create event
It will be seen that this code "glues" the player to the platform at times when possibly they ought to free-fall. I find the effect can be pleasing though. No extra effort is required to run uphill (yet). Most of the free-fall code could be skipped when there is no collision. The "jump" variable may not be necessary. It does help to "unstick" the player from the platform. Also at this time there is no support for special (non-solid) platforms. More to follow... Demo: |