// constructeur public Afficheur() { localplayer = new Player(); enemy = new Enemy(); affichemenu = new MainMenu(); scrolling = new Scroll(); }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base. Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { LoadConfigFile(); graphics.PreferredBackBufferWidth = GameConstants.HorizontalGameResolution; graphics.PreferredBackBufferHeight = GameConstants.VerticalGameResolution; graphics.IsFullScreen = GameConstants.IsGameInFullScreen; IsMouseVisible = GameConstants.IsMouseVisible; graphics.ApplyChanges(); kinectData = new KinectData(); camera = new Camera(graphics); if (kinectData.IsKinectConnected) { try { kinectData.KinectSensor.AllFramesReady += KinectAllFramesReady; kinectData.KinectSensor.SkeletonStream.Enable(); kinectData.KinectSensor.Start(); } catch { } } mainMenu = new MainMenu(this) {IsGameInMenuMode = true}; kinectPlayer = new KinectPlayer(new Vector3(GameConstants.FirstPlatformPosition + (GameConstants.RowLength/2)*GameConstants.SpaceBetweenPlatforms,GameConstants.PlatformGroundLevel,GameConstants.BeginningOfBoardPositionZ)); platformList = new List<Platform>(); platformGenerator=new PlatformCollection(); TargetElapsedTime = TimeSpan.FromSeconds(1.0f / GameConstants.GameUpdatesPerSecond); PreparePlatformsForNewGame(); base.Initialize(); }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { graphics.PreferredBackBufferWidth = 1280; graphics.PreferredBackBufferHeight = 720; graphics.IsFullScreen = false; IsMouseVisible = true; graphics.ApplyChanges(); cameraPosition = new Vector3(0.0f, 5.0f, 10.0f); moveOnlyOnceRight = true; moveOnlyOnceLeft = true; mainMenu = new MainMenu(graphics); platformList = new List<Platform>(); platformGenerator=new PlatformCollection(); var heroArrangement = new ObjectArrangementIn3D { Position = new Vector3(0.0f, 0.5f, 9.0f), Scale = new Vector3(0.5f, 0.5f, 0.5f), Rotation = new Vector3(0.0f) }; player = new Hero(heroArrangement); CreatePlatforms(PlatformCount, FirstPlatformPosition, DistanceBetweenPlatforms); base.Initialize(); }