protected override void Initialize()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            bleepHigh = Content.Load<SoundEffect>("bleep-high");
            bleepLow = Content.Load<SoundEffect>("bleep-low");
            //Ball texture
            spriteTexture = Content.Load<Texture2D>("ball1.png");
            //Border textures
            borderTexture = Content.Load<Texture2D>("bar.png");
            //Player Textures
            barTexture = Content.Load<Texture2D>("ball1.png");
            //Font texture
            font = Content.Load<SpriteFont>("font");

            test = new Rectangle(400, 400, 64, 64);
            base.Window.AllowUserResizing = false;

            //initialize bar controls
            topBarKeys[0] = Keys.T; //LEFT
            topBarKeys[1] = Keys.U; //RIGHT
            topBarKeys[2] = Keys.Y; //BOOST

            bottomBarKeys[0] = Keys.V; //LEFT
            bottomBarKeys[1] = Keys.N; //RIGHT
            bottomBarKeys[2] = Keys.B; //BOOST

            leftBarKeys[0] = Keys.A; //UP
            leftBarKeys[1] = Keys.D; //DOWN
            leftBarKeys[2] = Keys.S; //BOOST

            rightBarKeys[0] = Keys.L; //UP
            rightBarKeys[1] = Keys.J; //DOWN
            rightBarKeys[2] = Keys.K; //BOOST

            controls[0, 0] = topBarKeys[0];
            controls[0, 1] = topBarKeys[1];
            controls[0, 2] = topBarKeys[2];

            controls[1, 0] = bottomBarKeys[0];
            controls[1, 1] = bottomBarKeys[1];
            controls[1, 2] = bottomBarKeys[2];

            controls[2, 0] = leftBarKeys[0];
            controls[2, 1] = leftBarKeys[1];
            controls[2, 2] = leftBarKeys[2];

            controls[3, 0] = rightBarKeys[0];
            controls[3, 1] = rightBarKeys[1];
            controls[3, 2] = rightBarKeys[2];

            //initialize ball
            balls = new List<Ball>();
            balls.Insert(0, new Ball(fieldSize, ballSize, ballSpeed, ballSpeedLimit, ballSpeedInc, bounceCorrection, false, spriteBatch, spriteTexture));
            firstCycle = true;

            //initialize bars
            //barKeys = new Keys[][]{  topBarKeys, bottomBarKeys, leftBarKeys, rightBarKeys }; //put all the inputs in 1 array

            int barStartPos = (fieldSize - barLength) / 2;

            //initialize player lives
            playerLives = new int[4] {lives,lives,lives,lives};

            //powerup
            powerup = new Powerup[3];
            powerupCount = 0;
            for(int i=0;i<powerup.Length;i++)
            powerup[i] = new Powerup(spriteBatch, spriteTexture, GraphicsDevice,i);

            //Inititialize borders
            borders = new Border[4];
            borders[0] = new Border(spriteBatch, borderTexture, 0, 0, "Lying");//Top border
            borders[1] = new Border(spriteBatch, borderTexture, 0, (fieldSize - borderWidth), "Lying");//Bottom border
            borders[2] = new Border(spriteBatch, borderTexture, 0, 0, "Standing");//Left border
            borders[3] = new Border(spriteBatch, borderTexture, (fieldSize - borderWidth), 0, "Standing");//Right border

            //initialize players
            playerBars = new Bar[4];
            playerBars[0] = new Bar(borders, spriteBatch, barTexture, barStartPos, barToBorderDist, topBarKeys, "Lying");//Topp bar
            playerBars[1] = new Bar(borders, spriteBatch, barTexture, barStartPos, fieldSize - barToBorderDist - barWidth, bottomBarKeys, "Lying");//Bottom bar
            playerBars[2] = new Bar(borders, spriteBatch, barTexture, barToBorderDist, barStartPos, leftBarKeys ,"Standing");//Left bar
            playerBars[3] = new Bar(borders, spriteBatch, barTexture, fieldSize - barToBorderDist - barWidth, barStartPos, rightBarKeys ,"Standing");//Right bar

            input = new KeyboardController(controls);
            gameTime = 0;
            setPlayersAmount();

            base.Initialize();
        }
        //check if powerup gets hit. Execute powerup event.
        public void checkCollision(ref Rectangle ball,ref Bar[] bar, int lastHitBar,ref int[] playerlives, ref float ballXVelocity,ref  float ballYVelocity)
        {
            if(ball.Intersects(powerup)&&alive&&this.lastHitBar>=0)
            {
                Console.WriteLine("Powerup got hit");
                this.lastHitBar = lastHitBar;

                switch(powerupType)
                {
                    case 0:
                        redEvent(ref bar[lastHitBar]);
                        break;
                    case 1:
                        greenEvent(ref bar[lastHitBar]);
                        break;
                    case 2:
                        blueEvent(ref ballXVelocity,ref ballYVelocity);
                        break;
                    case 3:
                        goldEvent(ref playerlives[lastHitBar]);
                        break;
                    case 4:
                        purpleEvent(ref bar[lastHitBar]);
                        break;
                    default:
                        break;
                }

                alive = false;
                aliveTimer = 0;
                timer.reset();
            }
        }
 //Bad for the player
 public void redEvent(ref Bar bar)
 {
     Console.WriteLine("redEvent");
     if(bar.barLength-50>0)
     bar.barLength -= difference;
     if (lastHitBar > 1)
         bar.bar.Offset(0, (difference / 2));
     else
         bar.bar.Offset((difference / 2), 0);
 }
 //inverted controls
 public void purpleEvent(ref Bar bar)
 {
     Console.WriteLine("purpleEvent");
     Keys temp = bar.controls[0];
     bar.controls[0] = bar.controls[1];
     bar.controls[1] = temp;
 }
 //good for the player
 public void greenEvent(ref Bar bar)
 {
     Console.WriteLine("greenEvent");
     if (bar.barLength - 50 > 0)
         bar.barLength += difference;
     if (lastHitBar > 1)
         bar.bar.Offset(0, -(difference / 2));
     else
         bar.bar.Offset(-(difference / 2), 0);
 }
        /*
         * Updates the ball position and makes the ball bounce on a collision. Returns an int to indicate that a player loses a live. default = -1, top = 0 bottom = 1
         */
        public int updateBall(GameTime gameTime, Bar[] bars, Border[] borders, int[] lives)
        {
            if (!active)
                return -1;

            if (spawning)
            {
                if (!timer.getTimeDone(gameTime, 2))
                {
                    return -1;
                }
                spawning = false;

            }

            //barcollision
            for (int i = 0; i < 4; i++)
            {
                if (ball.Intersects(bars[i].bar))
                {
                    barBounce(i, bars[i].bar);
                    while (ball.Intersects(bars[i].bar))
                        moveBall(gameTime);
                    return -1;
                }
            }

            // check if ball touches the border if does that player loses a life and ball is reset

            for (int i = 0; i < 4; i++)
            {
                if (ball.Intersects(borders[i].border))
                {
                    if (lives[i].Equals(0))
                    {
                        simpleBounce(i);
                        while (ball.Intersects(borders[i].border))
                            moveBall(gameTime);
                        return -1;
                    }
                    else
                    {
                        return i;
                    }
                }
            }
            //the ball isnt in collision
            moveBall(gameTime);
            return -1;
        }