Ejemplo n.º 1
0
        public GameController(Rectangle worldBoundary, GameSettings pGameSettings)
        {
            ballManager           = new GraphicalManager();
            stickFigureManager    = new GraphicalManager();
            ballManager.Collided += BallManagerOnCollided;

            particleSystem = new ParticleSystem();

            worldParameters = new WorldParameters(GRAVITY, DAMPING, worldBoundary);

            Vector2 startLocation = new Vector2(worldBoundary.X + worldBoundary.Width / 2, worldBoundary.Y + worldBoundary.Height - 25);

            playerTurret = new Turret(startLocation, TURRET_START_ANGLE, TURRET_START_LENGTH,
                                      TURRET_BASE_WIDTH, TURRET_BASE_HEIGHT, TURRET_WIDTH);

            ballRadius = BALL_RADIUS;

            blastSound   = new SoundPlayer(Resources.Blast);
            flyAwaySound = new SoundPlayer(Resources.Comical_sounds_1);

            gameSettings = pGameSettings;

            AllowThrow        = true;
            RightArrowPressed = false;
            LeftArrowPressed  = false;
            PlaySounds        = true;
            ShouldFire        = false;
            Paused            = false;
            selectedBall      = null;
            rightClickedBall  = null;
            mouseLocation     = new Vector2(0, 0);
            selectedVector    = new Vector2(0, 0);
        }
 private void Awake()
 {
     ins = this;
 }