示例#1
0
 protected override void Initialize()
 {
     keyboard                   = new KeyboardController();
     gamepad                    = new GamepadController(this);
     camera                     = new Camera(UtilityClass.cameraHeight, UtilityClass.cameraWidth, new Vector2(UtilityClass.zero, UtilityClass.zero));
     pipeTransition             = new PipeTransition();
     skytransition              = new SkyWorldTransition();
     gameover                   = new GameOver(this);
     loader                     = new LevelLoader(UtilityClass.levelFile, camera);
     levelStore                 = new LevelStorage(camera);
     keyNotPressed              = new KeyNotPressed(this);
     fireBallCount              = UtilityClass.fireballLimit;
     iceBallCount               = UtilityClass.iceballLimit;
     pause                      = false;
     canPause                   = true;
     marioPause                 = false;
     stateTransistionPauseTimer = UtilityClass.stateTransistionTimer;
     time = new TimeStat(UtilityClass.LevelStartTime);
     gui  = new GUI();
     StatePuaseAlterationCall.setGame(this);
     AchievementPause.setGame(this);
     achievementManager = new AchievementManager();
     AchievementEventTracker.setManager(achievementManager);
     base.Initialize();
     tester = new TestingClass(this, levelStore);
     tester.runTests();
     AchievementEventTracker.endRunningTesting();
     pole                   = new Pole();
     flag                   = new Flag();
     hitFlagpole            = false;
     levelWon               = false;
     vine_box_hit           = false;
     VineClimbBeginLocation = new Vector2(30, 0);
 }
 public MovableCameraController(Camera camera, IPlayer mario, GamepadController gamepad, int lookDistance)
 {
     this.camera       = camera;
     cameraWidth       = camera.GetWidth();
     cameraPosition    = camera.GetPosition();
     this.mario        = mario;
     marioPosition     = mario.GetLocation();
     screenCenter      = cameraWidth / UtilityClass.two;
     this.gamepad      = gamepad;
     movementDistance  = 0;
     this.lookDistance = lookDistance;
 }