Ejemplo n.º 1
0
        public override void Execute()
        {
            //get a reference to the entity
            LogicEntity e = Contexts.sharedInstance.logic.GetEntityWithId(entityID);

            //jump logic
            jumpFX.Update(e.jumpsCompleted.value != 0 && (int)e.jumpsCompleted.value != lastJumpsCompleted, e);
            lastJumpsCompleted = e.jumpsCompleted.value;

            //walljump logic
            walljumpFX.Update(e.isWallJumping, e);

            //footsteps logic
            footstepsFX.Update(e.isGrounded && e.velocity.value.x.Abs() >= FixedMath.Tenth, e);

            //dash
            dashFX.Update(e.isDashing && e.hasLastVelocity &&
                          (e.lastVelocity.value.x.Abs() < FixedMath.Thousandth || e.lastVelocity.value.x.Sign() != e.velocity.value.x.Sign()), e);

            //wallride
            wallrideFX.Update(e.isWallRiding, e);

            //land
            landFX.Update(!e.isGrounded, e);

            /* need to get the while wall ride is happening code */



            //landFX.Update (e.isGrounded, e);
        }
        public override void Execute()
        {
            //get a reference to the entity
            LogicEntity e = Contexts.sharedInstance.logic.GetEntityWithId(entityID);

            //when the soul hits you
            deathFX.Update(!e.hasFreeze && e.hasDeathTimer, e);

            //when you start sludging
            sludgeFX.Update(!e.hasFreeze && e.hasDeathTimer, e);

            if (e.isDead || e.hasFreeze)
            {
                return;
            }

            //jump
            jumpFX.Update(e.jumpsCompleted.value != 0 && (int)e.jumpsCompleted.value != lastJumpsCompleted, e);
            lastJumpsCompleted = e.jumpsCompleted.value;

            //wall jump
            wallJumpFX.Update(e.isWallJumping, e);

            //stun
            stunFX.Update(e.isStunned, e);

            //run
            runFX.Update(e.isGrounded && e.velocity.value.x.Abs() >= FixedMath.Tenth, e);

            //dash
            dashFX.Update(e.isDashing && e.hasLastVelocity &&
                          (e.lastVelocity.value.x.Abs() < FixedMath.Thousandth || e.lastVelocity.value.x.Sign() != e.velocity.value.x.Sign()), e);

            //wallride
            wallrideFX.Update(e.isWallRiding, e);

            //fall + land
            fallFX.Update(!e.isGrounded, e);
        }
Ejemplo n.º 3
0
        public override void Execute()
        {
            LogicEntity e = Contexts.sharedInstance.logic.GetEntityWithId(entityID);

            hatDeathFX.Update(e.isDead, e);

            hitLevelFX.Update(!e.collisionInfo.value.DoesntCollide(), e);
            hitHatFX.Update(e.collisionInfo.value.CollidesWith(Tag.HAT), e);
            hitPlayerFX.Update(e.collisionInfo.value.CollidesWith(Tag.PLAYER), e);

            if (e.isDead || e.hasFreeze)
            {
                return;
            }

            attachFX.Update(e.isAttached, e);
            throwFX.Update(e.isDangerous && !e.isAttached, e);

            groundFX.Update(e.isGrounded && Mathf.Abs(e.velocity.value.x) > 2, e);
            airFX.Update(e.isGrounded, e);

            endDangerousFX.Update(e.isDangerous, e);
        }