Windows Ultimate Platform Engine

Discussion in 'Tutorials' started by scorpafied, Dec 22, 2019.

  1. scorpafied

    scorpafied Member

    Joined:
    Feb 8, 2019
    Posts:
    17
    Hello and welcome to my platform engine. (this was a collab between sp202 & me)

    GM Version
    : Gamemaker Studio 2
    Target Platform: Windows
    Links(screenshot): 1
    Download: Click Here

    Summary
    :
    the intention with this was to create a customisation platform engine, rich with features that was modular in design. so u could pick and choose what features were present.

    Tutorial
    :
    a quick intro, on the legacy forums i was known as x-death. i was known for helping out in the graphic forum and tutorials. i decided to come back and do this to help everyone out.

    here is a list of features the engine supports:
    - accelerated/decelerated movement (both linear and radial archs)
    - slopes
    - double jump (you can set this to as many jumps as youd like)
    - variable jumping
    - wall jumping (can be switched between single and double wall systems)
    - ledge grabbing: also includes jumping from the ledge, and climbing
    on top of the ledge.
    - sliding down walls
    - dash ability
    - ice
    - one way platforms
    - moving platforms (supports complex paths)
    - spring/bounce pads
    - push blocks
    - controller support

    and Secret Areas! (those objects need to be on there own layer)

    note: if you make a slope and u get collission issues, check the collision mask and make sure its set to precise (slow)

    we have also provided some recommended settings to
    help you replicate the acceleration and deceleration arcs of some
    popular games such as celeste and mario. as a means to teach you how to get your characters to
    play as you'd like. not to make clones. i used "game makers toolkit" youtube channel which had a great video on the arcs.

    here is some small sample code from the create event of the object that handles the characters physics, to show how customizable it:
    Code:
    /*
    Mechanics
    */
    jumpMax = 2; // max number of jumps possible
    walljump_activated = true;
    variable_jump_activated = true;
    ledge_grab_activated = true; // whether can grab ledges
    dash_activated=true; // whether dashing is currently enabled
    
    /*
    Customizable options for ingame stuff
    */
    // Accelleration & Horizontal Limits
    lin_acc=true; // handles the arc of acceleration, linear is true, radial is false
    lin_fric=true; // handles the arc of deceleration, linear is true, radial is false
    hsp_acc = 0.9//0.3; // rate of horizontal acceleration (new super mario bros uses 0.3 there abouts)
    hsp_acc_ice = 0.08; 
    hsp_push_block = 2; // max speed when pushing a block
    hsp_walk = 3; // max movement speed
    
    // Deccelleration
    hsp_fric_ground = 0.9; // rate of deccelleration if on ground (higher takes longer)
    hsp_fric_ice = 0.04;
    hsp_fric_air = 0.15; // rate of deccelleration if in air (higher takes longer)
    
    and some small sample code from the step event of the above object, i picked the dash ability so you can see how powerful the code is:
    Code:
    // Dashing
    if(dash_activated && (!ledgegrab)){
       if(key_dash&&(dash_current<0)&&(dashes>0)){
           dashes--;
           dash_current=dash_frames;
           dspx=key_right-key_left;
           dspy=key_down-key_up;
           if((dspx==0)&&(dspy==0))dspx=image_xscale;
           var mag = (dash_speed/sqrt((dspx*dspx)+(dspy*dspy)));
           dspx*=mag;
           dspy*=mag;
       }
      
       if(dash_current>=0){
           if(dash_stop_when_release&&(!key_dashHeld))dash_current=0;
           dash_current--;
           if(dash_current<0){
               var stopmul = dash_stop_speed/dash_speed;
               dspx*=stopmul;
               dspy*=stopmul;
           }
           hsp=round(dspx);
           vsp=round(dspy);
       }else{
           if(onground)dashes=dash_max;
       } 
    }
    
    i designed new graphics just havent used em yet. all feedback is welcome!
     
    Last edited: Jan 4, 2020
    Appletreeman likes this.
  2. Galla

    Galla Member

    Joined:
    Dec 28, 2019
    Posts:
    1
    Hi, ty for this engine its rly good. I have a question im trying to make the player stand on the push block while the push block is on the spring jumping right now if im standing im pushing the block down and it stops on the spring, is there any way the push block keeps bouncing on the sping while the player is standing on him? Im not the best programer so can u help me with pointing Where/Howt o start ?
     
  3. scorpafied

    scorpafied Member

    Joined:
    Feb 8, 2019
    Posts:
    17
    thanks for the kind words. ok so the physics of the character and push block is handled in oEntity. the spring is its own object. thats an interesting bug u found, im not sure whats causing it tbh. so ill take a look at it when i get a chance. if you wish to mess around with how much momentum the player maintains when he hits the spring that can be done within the spring object.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice