コード例 #1
0
        public Fairy(MovingActor player) : base(QuickGameScene.Current, Textures.FairyTexture)
        {
            Position.SetWidth(16, GameEngine.AnchorOrigin.Left);
            Position.SetHeight(16, GameEngine.AnchorOrigin.Top);
            Animations.Add(AnimationKeys.Stand, this, TextureFlipBehavior.None, 1, 2);

            new FairyBehavior(this, player);

            this.PositionRelativeTo(player, 0, 50);
        }
コード例 #2
0
        public FairyBehavior(MovingActor fairy, MovingActor player)
        {
            Fairy  = fairy;
            Player = player;
            fairy.Scene.AddObject(this);

            followPlayer = new OnceEvery(new Timer(TimeSpan.FromSeconds(1), Fairy));

            FairyMotion = new DirectedMotion();
            Fairy.Motion.AddAdjuster(FairyMotion);
        }