示例#1
0
        public void NewGame()
        {
            vitesse = new Vector2(0, 0);
            force = new Vector2(0, 300);

            random = new Random();
            score = 0;
            lost = false;
            startgame = false;

            player = new Player(Ressources.GetPerso(Perso.Choisi).name, pongBarre, new Vector2(1280 / 2 - pongBarre.Width / 2, 100 + 600 - pongBarre.Height));

            balle = new PongObject();
            balle.positionInitiale = new Vector2(1280 / 2 - balleTexture.Width / 2, 100 + 600 / 2 - balleTexture.Height);
            balle.position = balle.positionInitiale;
            balle.texture = balleTexture;
            balle.container = new Rectangle((int)balle.position.X, (int)balle.position.Y, balle.texture.Width, balle.texture.Height);

            font = Ressources.GetPerso(Perso.Choisi).font;
        }
示例#2
0
        public void LoadContent()
        {
            pongStart = Ressources.GetLangue(Langue.Choisie).pongStart;
            pongOver = Ressources.GetLangue(Langue.Choisie).pongOver;
            balleTexture = Ressources.Content.Load<Texture2D>("newGame/balle");
            pongBG = Ressources.Content.Load<Texture2D>("newGame/pongBG");
            pongBarre = Ressources.Content.Load<Texture2D>("newGame/pongBarre");

            player = new Player(Ressources.GetPerso(Perso.Choisi).name, pongBarre, new Vector2(467, 100 + 600 - pongBarre.Height));

            balle = new PongObject();
            balle.positionInitiale = new Vector2(1280 / 2 - balleTexture.Width / 2, 100 + 600 / 2 - balleTexture.Height);
            balle.position = balle.positionInitiale;
            balle.texture = balleTexture;
            balle.container = new Rectangle((int)balle.position.X, (int)balle.position.Y, balle.texture.Width, balle.texture.Height);

            font = Ressources.GetPerso(Perso.Choisi).font;
        }