コード例 #1
0
        public PlayerManager(
            Texture2D texture,
            Rectangle initialFrame,
            int frameCount,
            Rectangle screenBounds)
        {
            playerSprite = new Sprite(
                new Vector2(500, 500),
                texture,
                initialFrame,
                Vector2.Zero);

            PlayerShotManager = new ShotManager(
                texture,
                new Rectangle(681, 547, 15, 35),
                1,
                2,
                250f,
                screenBounds);

            playerAreaLimit =
                new Rectangle(
                    0,
                    screenBounds.Height / 2,
                    screenBounds.Width,
                    screenBounds.Height / 2);


            for (int x = 1; x < frameCount; x++)
            {
                playerSprite.AddFrame(
                    new Rectangle(
                        initialFrame.X + (initialFrame.Width * x),
                        initialFrame.Y,
                        initialFrame.Width,
                        initialFrame.Height));
            }
            playerSprite.CollisionRadius = playerRadius;
        }
コード例 #2
0
        public EnemyManager(
            Texture2D texture,
            Rectangle initialFrame,
            int frameCount,
            PlayerManager playerManager,
            Rectangle screenBounds)
        {
            this.texture       = texture;
            this.initialFrame  = initialFrame;
            this.frameCount    = frameCount;
            this.playerManager = playerManager;

            EnemyShotManager = new ShotManager(
                texture,
                new Rectangle(681, 547, 15, 35),
                1,
                1,
                150f,
                screenBounds);

            setUpWaypoints();
        }