示例#1
0
        public Mouse()
        {
            Transform
            .Create(this)
            .SetPosition(STARTPOSITION)
            .SetSpeed(120)
            .SetOrientation(-Vector2.UnitX)
            .SetUpdateZWithPosition(true)
            .SetScale(1.0f);

            Sprite
            .Create(this)
            .SetEnableNormalMap(false)
            .SetImage(content.characters.mouse.sprite, 9, 7);

            SpriteTransformAnimation
            .Create(this)
            .SetSetFrameFn(SetFrame);

            SpriteCustomAnimation
            .Create(this)
            .SetGetFramesAction(GetCustomAnimationFrames);

            SpriteData
            .Create(this)
            .SetOrientationFlip(false)
            .SetOffset(-7, -13);

            Navigation
            .Create(this)
            .SetApplyScale(false)
            .SetApplyColoring(false)
            .SetRestrictPosition(true)
            .SetScale(1.0f);

            Scripts
            .Create(this);

            CameraLocked
            .Create(this)
            .SetEnabled(false);

            Visible = false;
            Enabled = false;
        }
示例#2
0
        public Ryan(Inventory inventory)
        {
            Inventory = inventory;

            CameraLocked
            .Create(this);

            Transform
            .Create(this)
            .SetPosition(350, 250)
            .SetSpeed(120)
            .SetOrientation(-Vector2.UnitY)
            .SetUpdateZWithPosition(true)
            .SetScale(1.0f);

            Sprite
            .Create(this)
            .SetEnableNormalMap(false)
            .SetImage(content.characters.ryan.sprite_blood, 13, 8, 0);

            SpriteTransformAnimation
            .Create(this)
            .SetSetFrameFn(SetFrame);

            SpriteCustomAnimation
            .Create(this)
            .SetGetFramesAction(GetCustomAnimationFrames);

            SpriteData
            .Create(this)
            .SetOrientationFlip(false)
            .SetOffset(-76, -143);

            Text
            .Create(this)
            .SetFont(content.fonts.pixeloperator_outline_BMF)
            .SetWidth(300)
            .SetConstrain(true)
            .SetConstrainingRectangle(new Rectangle(0, 0, Game.VIRTUAL_WIDTH, Game.VIRTUAL_HEIGHT))
            .SetAlign(Alignment.Bottom);

            Navigation
            .Create(this)
            .SetApplyScale(true)
            .SetApplyColoring(true)
            .SetRestrictPosition(true)
            .SetScale(1.75f);

            Scripts
            .Create(this);

            Lightning
            .Create(this)
            .SetLightPosition(new Vector3(new Vector2(51, 61), 0))
            .SetLightColor(new Vector3(1.25f, 0.6f, 0.6f));

            BloodDropEmitter
            .Create(this);

            Score
            .Create(this);

            RandomCountdown
            .Create(this)
            .SetDuration(7)
            .SetMinUpdates(300)
            .SetMaxUpdates(500);
        }