public Gamestate(Background bg, Player player1, Player player2, FloatingMan fll)
 {
     this.background = bg;
     this.player1    = player1;
     this.player2    = player2;
     this.floot      = fll;
 }
Esempio n. 2
0
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            font        = Content.Load <SpriteFont>("File");

            // laad de sprite
            KickSound = Content.Load <Song>("Whoosh");

            for (int i = 0; i < 28; ++i)
            {
                FlyThing.Add(Content.Load <Texture2D>(("F" + Convert.ToString(100 + i))));
            }
            for (int i = 0; i < 8; ++i)
            {
                DuckAnimations.Add(Content.Load <Texture2D>(("DUCK" + Convert.ToString(i + 1))));
            }
            for (int i = 0; i < 4; ++i)
            {
                JPunchAnimations.Add(Content.Load <Texture2D>(("Jpunch" + Convert.ToString(i + 1))));
            }
            JPunchAnimations.Add(Content.Load <Texture2D>(("Jpunch4")));
            JPunchAnimations.Add(Content.Load <Texture2D>(("Jpunch4")));
            for (int i = 0; i < 7; ++i)
            {
                JKickAnimations.Add(Content.Load <Texture2D>(("JKICK" + Convert.ToString(i + 1))));
            }
            for (int i = 0; i < 13; ++i)
            {
                KickAnimations.Add(Content.Load <Texture2D>(("KICK" + Convert.ToString(i + 1))));
            }
            for (int i = 0; i < 10; ++i)
            {
                JumpAnimations.Add(Content.Load <Texture2D>(("JUMP" + Convert.ToString(i + 1))));
            }
            for (int i = 0; i < 11; ++i)
            {
                WalkAnimations.Add(Content.Load <Texture2D>(("WALK" + Convert.ToString(i + 1))));
            }
            for (int i = 0; i < 11; ++i)
            {
                WalkBAnimations.Add(Content.Load <Texture2D>(("WALKB" + Convert.ToString(i + 1))));
            }
            for (int i = 0; i < 9; ++i)
            {
                PunchAnimations.Add(Content.Load <Texture2D>(("PUNCH" + Convert.ToString(i + 1))));
            }
            for (int i = 0; i < 10; ++i)
            {
                IdleAnimations.Add(Content.Load <Texture2D>(("IDLE" + Convert.ToString(i + 1))));
            }

            BG1 = Content.Load <Texture2D>("BG1");
            BG2 = Content.Load <Texture2D>("BG2");
            BG3 = Content.Load <Texture2D>("BG3");
            BG4 = Content.Load <Texture2D>("BG4");
            BG5 = Content.Load <Texture2D>("BG5");
            BG6 = Content.Load <Texture2D>("BG6");
            BG7 = Content.Load <Texture2D>("BG7");
            BG8 = Content.Load <Texture2D>("BG8");


            barplayer1 = new Healthbar(font, Height, Width, "left");
            barplayer2 = new Healthbar(font, Height, Width, "right");


            background      = new Background(BG1, BG2, BG3, BG4, BG5, BG6, BG7, BG8, Width, Height);
            Player2Movement = new PlayerInput(Keys.Right, Keys.Left, Keys.Down, Keys.Up, Keys.O, Keys.P, PlayerIndex.One);
            Player1Movement = new PlayerInput(Keys.D, Keys.A, Keys.S, Keys.W, Keys.C, Keys.V, PlayerIndex.Two);
            player1         = new Player(100, barplayer1, JKickAnimations, JPunchAnimations, KickSound, Player1Movement, groundline, Width, Height, IdleAnimations, WalkAnimations, WalkBAnimations, JumpAnimations, PunchAnimations, KickAnimations, DuckAnimations);
            player2         = new Player(Width - 100, barplayer2, JKickAnimations, JPunchAnimations, KickSound, Player2Movement, groundline, Width, Height, IdleAnimations, WalkAnimations, WalkBAnimations, JumpAnimations, PunchAnimations, KickAnimations, DuckAnimations);
            floot           = new FloatingMan(Height, Width, FlyThing, font);
            gamestate       = new Gamestate(background, player1, player2, floot);
        }