Exemplo n.º 1
0
 void Start()
 {
     rb            = GetComponent <Rigidbody2D>();
     state         = GetComponent <Player_State>();
     animator      = GetComponent <Player_Animator>();
     timers        = GetComponent <Player_Timers>();
     attributes    = state.attributes;
     wallActions   = GetComponent <Player_Wall_Actions>();
     pJump         = GetComponent <Player_Jump>();
     pDash         = GetComponent <Player_Dash>();
     pDive         = GetComponent <Player_Dive>();
     pCol          = GetComponent <Player_Collisions>();
     pAttack       = GetComponent <Player_Attack>();
     move          = GetComponent <Player_Move>();
     playerManager = GetComponent <PlayerManager>();
     rb.drag       = 0.5f;
     rb.mass       = 1.5f;
     ReceiveValues();
     moveSpeed          = attributes.moveSpeed;
     jumpVelocity       = attributes.jumpVelocity;
     maxDescendAngle    = attributes.maxDescendAngle;
     dashSpeed          = attributes.dashSpeed;
     momentumFactor     = attributes.momentumFactor;
     wallSlideSpeed     = attributes.wallSlideSpeed;
     pivotTime          = attributes.pivotTime;
     diveAttackTime     = attributes.diveAttackTime;
     momentumTime       = attributes.momentumTime;
     wallStickCooldown  = attributes.wallStickCooldown;
     terminalVel        = new Vector2(dashSpeed / 2.0f, dashSpeed / 2.5f);
     airTerminalVel     = new Vector2(dashSpeed / 3.0f, dashSpeed);
     slopeCollisionMask = attributes.slopeCollisionMask;
     gravity            = attributes.gravity;
 }
Exemplo n.º 2
0
 void MakeInstance()
 {
     if (playerJumpInstance == null)
     {
         playerJumpInstance = this;
     }
 }
Exemplo n.º 3
0
 void Start()
 {
     pc           = GetComponent <Player_Con>();
     animator     = GetComponent <Player_Animator>();
     timers       = GetComponent <Player_Timers>();
     pDash        = GetComponent <Player_Dash>();
     pJump        = GetComponent <Player_Jump>();
     pDive        = GetComponent <Player_Dive>();
     pCol         = GetComponent <Player_Collisions>();
     pAttack      = GetComponent <Player_Attack>();
     wallActions  = GetComponent <Player_Wall_Actions>();
     speedManager = GetComponent <Speed_Manager>();
     ReceiveValues();
     jumpTime          = attributes.jumpTime;
     displacementTime  = attributes.displacementTime;
     pivotTime         = attributes.pivotTime;
     momentumTime      = attributes.momentumTime;
     wallStickCooldown = attributes.wallStickCooldown;
     jumpCount         = 2;
     sign         = 0.0f;
     prevSign     = 1.0f;
     wallSign     = 0.0f;
     jumpDirX     = 0.0f;
     enemyColSign = 0.0f;
     control      = true;
     airborne     = true;
     //Lines below for testing purposes
     dive       = true;
     dash       = true;
     doubleJump = true;
 }
Exemplo n.º 4
0
    void Awake()
    {
        //Get references
        p    = GetComponent <Player>();
        rb   = GetComponent <Rigidbody2D>();
        cf   = GetComponent <ConstantForce2D>();
        sr   = GetComponent <SpriteRenderer>();
        cc   = GetComponent <CapsuleCollider2D>();
        anim = GetComponent <Animator>();

        ph = GetComponent <Player_Health>();
        pf = GetComponent <Player_Fire>();
        pm = GetComponent <Player_Movement>();
        pj = GetComponent <Player_Jump>();
        pc = GetComponent <Player_Currency>();

        instance = this; //Set instance to this player

        //Get the collider for the player's dead state
        deadCollider         = transform.Find("Dead Collider").GetComponent <CapsuleCollider2D>();
        deadCollider.enabled = false; //Set inactive
    }
Exemplo n.º 5
0
 void Start()
 {
     turning     = this.GetComponent <Turning>();
     player_Jump = this.GetComponent <Player_Jump>();
     player      = transform.GetChild(0);
 }