Пример #1
0
        //Environment Constructor
        public AngryBallsEnvironment()
        {
            //Initialize the Buttons
            playPauseButton = new PlayPauseButton(gameState);
            builderButton = new BuilderButton(gameState);

            background = Game1.environmentBackground;
            border = Game1.borderImage;
            bigCog = Game1.bigCog;
            clawOpen = Game1.clawOpen;
            Input = new InputManager();
            map = new Map();
            //justClicked = false;
            toolBox = new ToolBox();
            gameState = GameState.run;
            angryBall = new FarseerBall(ballStartPose);

            //Physics Bodies for Walls
            leftWall = BodyFactory.CreateRectangle(Game1.world, UnitConverter.toSimSpace(10), UnitConverter.toSimSpace(2450), 1.0f, leftWallPosition);
            leftWall.BodyType = BodyType.Static;
            rightWall = BodyFactory.CreateRectangle(Game1.world, UnitConverter.toSimSpace(10), UnitConverter.toSimSpace(2550), 1.0f, rightWallPosition);
            rightWall.BodyType = BodyType.Static;
            ceiling = BodyFactory.CreateRectangle(Game1.world, UnitConverter.toSimSpace(960), UnitConverter.toSimSpace(10), 1.0f, ceilingPosition);
            ceiling.BodyType = BodyType.Static;
            floor = BodyFactory.CreateRectangle(Game1.world, UnitConverter.toSimSpace(960), UnitConverter.toSimSpace(10), 1.0f, floorPosition);
            floor.BodyType = BodyType.Static;
        }
Пример #2
0
        //Environment Constructor
        public AngryBallsEnvironment()
        {
            //Instantiate the Buttons
            gameState = GameState.initialize;
            playPauseButton = new PlayPauseButton(gameState);
            resetButton = new ResetButton(gameState);
            builderButton = new BuilderButton(gameState);
            saveButton = new SaveButton(gameState);
            loadButton = new LoadButton(gameState);

            // Instantiate Dialog Box
            dialog = new Dialog(loadButton, saveButton);

            //Instantiate Start Positions for environment items
            clawopenPosition = clawStartPosition;
            ballStartPose = new Vector2(clawStartPosition.X + 47, clawStartPosition.Y + 150);

            //Instantiate local images
            background = Game1.environmentBackground;
            border = Game1.borderImage;
            bigCogImage = Game1.bigCog;
            bigCogOrigin = new Vector2(bigCogImage.Width / 2, bigCogImage.Height / 2);
            springImage = Game1.springImage;
            chickenImage = Game1.chickenImage;
            clawOpen = Game1.clawOpen;

            //Instantiate environment containers
            Input = new InputManager();
            map = new Map();
            toolBox = new ToolBox();
        }