コード例 #1
0
        public void Initialize()
        {
            // Create the sprites for the Wumpus and character
            PlayerCharacter = new Sprite2D(PlayerTexture, Scale: 0.1f);
            Wumpus          = new Sprite2D(WumpusTexture, Scale: 0.1f);

            PlayerCharacter.CenterOrigin();
            Wumpus.CenterOrigin();

            // Add the movement animations to make it less abrupt
            PlayerCharacter.AddAnimation(AnimationType.MoveToNewMenuTile, new SpriteMoveAnimation(dist => dist / 75f));
            Wumpus.AddAnimation(AnimationType.MoveToNewMenuTile, new SpriteMoveAnimation(dist => dist / 75f));

            // Initialize the animations
            PlayerCharacter.Initialize();
            Wumpus.Initialize();

            // Start the animations
            PlayerCharacter.StartAnimation(AnimationType.MoveToNewMenuTile);
            Wumpus.StartAnimation(AnimationType.MoveToNewMenuTile);
        }