Beispiel #1
0
    // Update is called once per frame
    override protected void Update()
    {
        beliefArray[0] = Agent;
        beliefArray[1] = Action;
        beliefArray[2] = Interaction;
        beliefArray[3] = Result;

        if (Agent != "empty" && Action != "empty" && Interaction != "empty")
        {
            beliefArrayComplete = true;
        }


        if (_state == SMBConstants.EnemyState.Dead)
        {
            return;
        }

        SMBConstants.MoveDirection side = SMBConstants.MoveDirection.Forward;
        if (isFlipped())
        {
            side = SMBConstants.MoveDirection.Backward;
        }

        Move(xSpeed * (float)side);

        base.Update();
    }
	void Coast(SMBConstants.MoveDirection direction) {

		if (!_isOnGround)
			return;

		float xDirection = _body.velocity.x >= 0f ? 1f : -1f;

		if (Mathf.Abs (_body.velocity.x) > minVelocityToCoast && xDirection == -(float)direction) {

			_animator.Play ("Coasting");

			_isCoasting = true;
			_runningTimer = 0f;

			_particleSystem._shootParticles = true;
		}
	}
Beispiel #3
0
    // Update is called once per frame
    override protected void Update()
    {
        if (_state == SMBConstants.EnemyState.Dead)
        {
            return;
        }

        SMBConstants.MoveDirection side = SMBConstants.MoveDirection.Forward;
        if (isFlipped())
        {
            side = SMBConstants.MoveDirection.Backward;
        }

        Move(xSpeed * (float)side);

        base.Update();
    }