void Awake()
 {
     collision    = GetComponent <Collision>();
     rigidbody    = GetComponent <Rigidbody2D>();
     improvedJump = GetComponent <ImprovedJump>();
     ghostTrail   = GetComponent <GhostTrail>();
 }
Esempio n. 2
0
 private void InstantiateGhost()
 {
     if (FindObjectOfType <GhostTrail>() == null)
     {
         GameObject clone = Instantiate(ghost, new Vector2(-20, -20), Quaternion.identity);
         cloneGhost = clone.GetComponent <GhostTrail>();
     }
 }
Esempio n. 3
0
    private void Start() // This is called when the level start so only once
    {
        x      = Input.GetAxisRaw("Horizontal");
        anim   = GetComponent <Animator>();    // Initialize the animator for when the game starts
        rigidy = GetComponent <Rigidbody2D>(); // Initialize the rigidbody for the player
        ghost  = GetComponent <GhostTrail>();

        facingRight = true;
    }
Esempio n. 4
0
    protected override void OnAwake()
    {
        base.OnAwake();
        dashAB = gameObject.AddComponent <Ability>() as Ability;
        dashAB.InitSetParams(dashDuration, dashInvertal);

        if (ghostTrail == null)
        {
            ghostTrail = FindObjectOfType <GhostTrail>();
        }
    }
Esempio n. 5
0
    // Start is called before the first frame update
    void Start()
    {
        rb   = GetComponent <Rigidbody2D>();
        anim = GetComponent <Animator>();
        cam  = FindObjectOfType <CameraController>();

        ghostTrail   = this.GetComponent <GhostTrail>();
        jumpParticle = transform.GetChild(0).GetComponent <ParticleSystem>();

        facingRight       = true;
        GRAVITY           = rb.gravityScale;
        DRAG              = rb.drag;
        jumpTimerLeft     = 0;
        isWalking         = true;
        rb.freezeRotation = true;

        dashVanilla = Dash(direction, DASH_FORCE, DASH_TIME, DASH_DRAG);
        dashBounce  = Dash(direction, DASH_FORCE, DASH_TIME, DASH_DRAG);
    }
Esempio n. 6
0
    //public float respawnDelay;

    // Start is called before the first frame update
    void Start()
    {
        player = FindObjectOfType <Movement>();
        ghost  = FindObjectOfType <GhostTrail>();
        resets = FindObjectsOfType <DashReset>();
    }
 private void Awake()
 {
     lm   = GameObject.FindGameObjectWithTag("Levelman").GetComponent <LevelMaster>();
     move = GetComponent <GhostTrail>();
     sA   = GameObject.FindGameObjectWithTag("Special").GetComponent <SpecialAttack>().instance;
 }
Esempio n. 8
0
 private void Awake()
 {
     lm   = GameObject.FindGameObjectWithTag("Levelman").GetComponent <LevelMaster>();
     move = GetComponent <GhostTrail>();
 }