public override void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character)
 {
     if (collider.direction == RC_Direction.DOWN) {
         characterIsOnMe = true;
         standTimer = standTime;
     }
 }
 override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character)
 {
     if (collider.direction == RC_Direction.DOWN)
     {
         character.Velocity = new Vector3(character.Velocity.x, springForce);
     }
 }
 public override void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character)
 {
     if (collider.direction == RC_Direction.DOWN && !fallStarted) {
         fallStarted = true;
         StartCoroutine(Fall());
     }
 }
Example #4
0
	override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character) {
		// If we are standing on this
		if (!alreadyAdded && collider.direction == RC_Direction.DOWN) {
			character.Velocity += speed;
			alreadyAdded = true;
		}
	}
Example #5
0
 /// <summary>
 /// Stand on a respawn point to activate it. You could play a particle effect of something here.
 /// </summary>
 override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character)
 {
     if (collider.direction == RC_Direction.DOWN)
     {
         currentRespawnPoint = this;
     }
 }
 override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character)
 {
     if (character.FallThroughTimer <= 0.0f && collider.direction == RC_Direction.DOWN && character.characterInput.dropFromPlatform)
     {
         character.FallThroughTimer = fallThroughTime;
     }
 }
 override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character)
 {
     if (collider.direction == RC_Direction.DOWN)
     {
         characterIsOnMe = true;
         standTimer      = standTime;
     }
 }
Example #8
0
	override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character) {
		// Hitting from below
		if (collider.direction == RC_Direction.UP) {
			if (particles != null) particles.Play();
			myCollider.enabled = false;
			myRenderer.enabled = false;
		}
	}
Example #9
0
	override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character) {
		if (character.StartedClimbing) {
			// Move off ladder
			if (control.dismountWithArrows && character.characterInput.x != 0.0f) {
				character.Dismount(this);
			}
		} 
	}
 override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character)
 {
     if (collider.direction == RC_Direction.DOWN && !fallStarted)
     {
         fallStarted = true;
         StartCoroutine(Fall());
     }
 }
 override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character)
 {
     // If we are standing on this
     if (!alreadyAdded && collider.direction == RC_Direction.DOWN)
     {
         character.SetDrag(drag);
         alreadyAdded = true;
     }
 }
Example #12
0
    /// <summary>
    /// Trigger the respawn.
    /// </summary>
    override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character)
    {
        SimpleHealth2D health = character.GetComponent <SimpleHealth2D>();

        if (health != null && health.Health > 0)
        {
            health.Die();
        }
    }
Example #13
0
 override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character)
 {
     if (character.StartedClimbing)
     {
         // Move off ladder
         if (control.dismountWithArrows && character.characterInput.x != 0.0f)
         {
             character.Dismount(this);
         }
     }
 }
Example #14
0
 override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character)
 {
     // Hitting from below
     if (collider.direction == RC_Direction.UP)
     {
         if (particles != null)
         {
             particles.Play();
         }
         myCollider.enabled = false;
         myRenderer.enabled = false;
     }
 }
Example #15
0
	override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character) {
		// Hitting from below (i.e. a headbutt)
		if (isActive && collider.direction == RC_Direction.UP) {
			StartCoroutine(DoHit());
			if (spawnGameObject != null && !hasSpawned) StartCoroutine(DoSpawn());
			else if (spawnGameObject != null) DoBobble();
		}
		// Kill enemies above 
		/*else if (!isActive && collider.direction == RC_Direction.DOWN && character is IEnemy) {
			((IEnemy)character).Kill();
		}
		*/
	}
Example #16
0
    void Start()
    {
        raycastCollider = GetComponent <RaycastCollider2D>();
        input           = GetComponent <InputManager>();
        timers          = GetComponent <Timers>();
        stats           = GetComponent <PlayerStats>();
        sprite          = GetComponent <SpriteRenderer>();
        anim            = GetComponent <CharacterAnimationController>();

        // Init all timers
        timers.RegisterTimer("jumpBuffer", inputBufferTimeSeconds);
        timers.RegisterTimer("coyoteBuffer", coyoteTimeSeconds);
        timers.RegisterTimer("platformFallThrough", platformFallThroughSeconds);
        timers.RegisterTimer("dashBuffer", dashCooldownSeconds);

        // make teleporter sprite deactivated
        teleporter.GetComponent <Renderer>().enabled = false;
    }
    override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character)
    {
        // Hitting from below (i.e. a headbutt)
        if (isActive && collider.direction == RC_Direction.UP)
        {
            StartCoroutine(DoHit());
            if (spawnGameObject != null && !hasSpawned)
            {
                StartCoroutine(DoSpawn());
            }
            else if (spawnGameObject != null)
            {
                DoBobble();
            }
        }
        // Kill enemies above

        /*else if (!isActive && collider.direction == RC_Direction.DOWN && character is IEnemy) {
         *      ((IEnemy)character).Kill();
         * }
         */
    }
Example #18
0
	/// <summary>
	/// This is called when a platform is hit. Override to implement platform behaviour.
	/// </summary>
	/// <param name='collider'>
	/// The collider that did the hitting.
	/// </param>
	/// <param name='character'>
	/// The character that did the hitting.
	/// </param>
	virtual public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character) {
		// Do nothing
	}
	override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character) {
		if (character.FallThroughTimer <= 0.0f && collider.direction == RC_Direction.DOWN && character.characterInput.dropFromPlatform) {
			character.FallThroughTimer = fallThroughTime;
		}
	}
	override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character) {
		if (collider.direction == RC_Direction.DOWN) {
			character.Velocity = new Vector3(character.Velocity.x, springForce);
		}
	}
Example #21
0
	/// <summary>
	/// Trigger the respawn.
	/// </summary>
	override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character) {
		SimpleHealth2D health = character.GetComponent<SimpleHealth2D>();
		if (health != null && health.Health > 0) {
			health.Die ();
		}
	}
Example #22
0
 public void Init(RaycastCollider2D raycastCollider)
 {
     parentRaycast = raycastCollider;
     Reset();
 }
Example #23
0
 /// <summary>
 /// This is called when a platform is hit. Override to implement platform behaviour.
 /// </summary>
 /// <param name='collider'>
 /// The collider that did the hitting.
 /// </param>
 /// <param name='character'>
 /// The character that did the hitting.
 /// </param>
 virtual public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character)
 {
     // Do nothing
 }
Example #24
0
	/// <summary>
	/// Stand on a respawn point to activate it. You could play a particle effect of something here.
	/// </summary>
	override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character) {
		if (collider.direction == RC_Direction.DOWN) currentRespawnPoint = this;
	}