コード例 #1
0
ファイル: Enemy.cs プロジェクト: ggjbj/CardiacArrest1
        public void Load()
        {
            // Set user screen position
            Position = new Vector2(500, 200);

            AnimationClass EnemyAni = new AnimationClass();

            Color enemyColour = new Color();
            enemyColour = Color.Red;
            float scale = 0.3f;

            // Create instances in the library for each animation
            EnemyAni.Rotation = MathHelper.PiOver4 * 2;
            AddAnimation("Walking", 2, 8, EnemyAni.Copy(), enemyColour, scale);

            EnemyAni.Rotation = MathHelper.PiOver4 * 2;
            AddAnimation("Fire", 3, 4, EnemyAni.Copy(), enemyColour, scale);

            EnemyAni.Rotation = MathHelper.PiOver4 * 2;
            AddAnimation("Knife", 3, 4, EnemyAni.Copy(), enemyColour, scale);

            EnemyAni.Rotation = MathHelper.PiOver4 * 2;
            AddAnimation("Idle", 1, 8, EnemyAni.Copy(), enemyColour, scale);

            // Set default user animation
            Animation = "Idle";
        }
コード例 #2
0
ファイル: Player.cs プロジェクト: ggjbj/CardiacArrest1
        public void Load()
        {
            // Set user screen position
            Position = new Vector2(80, 200);

            AnimationClass playerAni = new AnimationClass();

            Color playerColour = new Color();
            playerColour = Color.Blue;
            float scale = 0.3f;

            // Create instances in the library for each animation
            playerAni.Rotation = 0f;
            AddAnimation("Climb", 1, 8, playerAni.Copy(), playerColour, scale);

            playerAni.Rotation = 0f;
            AddAnimation("Crouch", 3, 4, playerAni.Copy(), playerColour, scale);

            playerAni.Rotation = MathHelper.PiOver4 * 2;
            AddAnimation("Walking", 1, 8, playerAni.Copy(), playerColour, scale);

            playerAni.Rotation = MathHelper.PiOver4 * 2;
            AddAnimation("Fire", 3, 4, playerAni.Copy(), playerColour, scale);

            playerAni.Rotation = MathHelper.PiOver4 * 2;
            AddAnimation("Knife", 3, 4, playerAni.Copy(), playerColour, scale);

            playerAni.Rotation = MathHelper.PiOver4 * 2;
            AddAnimation("Idle", 2, 8, playerAni.Copy(), playerColour, scale);

            playerAni.Rotation = MathHelper.PiOver4 * 2;
            AddAnimation("Jump", 2, 8, playerAni.Copy(), playerColour, scale);

            // Set default user animation
            Animation = "Idle";
        }