Example #1
0
        public void GrabBall(Ball ball)
        {
            if (!CantCatch)
            {
                HeldBall = ball;

                ball.TimeWithBall = 0f;
                ball.Possessor = this;
                ball.State = Ball.BallState.Held;
            }
        }
Example #2
0
        public void Initialize()
        {
            PlaySpace = new Field();
            Scoreboard = new Scoreboard();

            Vector2 windowSize = new Vector2(pixlGame.GraphicsDevice.Viewport.Width,
                                                 pixlGame.GraphicsDevice.Viewport.Height);
            Vector2 psp;
            psp.X = (windowSize.X - PlaySpace.RenderSize.X) / 2f;
            psp.Y = windowSize.Y - PlaySpace.RenderSize.Y - 50f;

            PlaySpace.Position = psp;

            Team1 = new Team("Broadway Bisons", this);
            Team2 = new Team("New Jersey Devils", this);
            Ball = new Ball();

            Team1.Initialize();
            Team2.Initialize();

            /*

            KeyboardResult = Guide.BeginShowKeyboardInput(PlayerIndex.One, "TeamName entry", "Enter the team's name here", "Boradway Bisons", null, null);
            Team1.TeamName = Guide.EndShowKeyboardInput(KeyboardResult);

            */

            Team1.Color = Color.Cyan;
            Team2.Color = new Color(167, 167, 167);

            AudioM = new AudioManager();
            AudioM.Initialize();

            time = QUARTERTIME;

            AddRule(new OutOfBounds(this, new LightOnFire(Judgement.JudgementType.TeamMember)));
            AddRule(new OutOfBounds(this, new Rebound(this)));
            AddRule(new RunInGoal(this, new ScoreExchange(this)));
            AddRule(new ThroughThePostsGoal(this, new ScoreChange(this, 7)));
            AddRule(new OutTheBackGoal(this, new Rebound(this)));
            AddRule(new PassInGoal(this, new ScoreChange(this, 5)));

            AddPlayer(Team1, InputController.InputMode.Player1);
            AddPlayer(Team2, InputController.InputMode.Player2);

            MenuM = new MenuManager(this);
            MenuM.Initialize();
        }