Exemple #1
0
        public void initializeWorld()
        {
            graphics.PreferredBackBufferWidth = 1280;
            graphics.PreferredBackBufferHeight = 720;

            // pausedText.changeFontSize(100);

            this.graphics.IsFullScreen = Game1.instance.chooseFullScreen;
            graphics.ApplyChanges();

            cameraViewMatrix = Matrix.CreateLookAt(
                cameraPosition,
                cameraLookAt,
                Vector3.Up);

            cameraProjectionMatrix = Matrix.CreatePerspectiveFieldOfView(
                MathHelper.ToRadians(45.0f),
                graphics.GraphicsDevice.Viewport.AspectRatio,
                1.0f,
                10000.0f);

            // TODO: Add your initialization logic here
            //create rooster
            roosterList[0] = new RoosterClass(content, graphics);
            roosterList[0].InitializeRooster(13);

            //create multiple chickens
            //initialize chickens
            chickenList[0] = new ChickenClass(content, graphics);
            chickenList[0].InitializeChicken(0);

            //on button press/chicken buy selection create another chicken object
            //add graphics, and initialize then add to chickenlist

            //initialize character
            myCharacter = new CharacterClass(content, graphics);
            myCharacter.InitializeCharacter();

            //initialize broken egg
            brokenEggList[0] = new BrokenEggClass(content, graphics);
            brokenEggList[0].initializeBrokenEgg();

            //initialize egg
            eggList[0] = new EggClass(content, graphics);
            eggList[0].initializeEgg();

            //initialize egg shadow
            shadowList[0] = new EggShadowClass(content, graphics);
            shadowList[0].initializeEggShadow();

            //initilize fox
            myFox = new FoxClass(content, graphics);
            myFox.initializeFox(new Vector3(3600, 80, 3600), numChic);

            //economics
            player = new EconomicsClass();
            player.InitializeEconomic();

            //boots
            myBootList[0] = new RubberBootClass(content, graphics);
            myBootList[0].initializeBoots();

            //win/loss
            winLoss = new VictoryConditionClass();
            winLoss.initializeVictory();

            //initilize all data
            isPaused = true;

            //camera
            cameraPosition = new Vector3(3500.0f, 450.0f, 6000.0f); //initial camera position
            camRearOffset = 1000.0f; //default distance between camera and character
            camHeightOffset = 800f; //default distance between camera and ground
            maxCamHeight = 2000f;
            minCamHeight = 200f;
            maxCamOffset = 3000f;
            minCamOffset = 200f;

            //roosters
            numRooster = 1; //initial number of roosters
            maxRooster = 5; //max number of roosters
            roosterTime = 0; //tracks number of seconds since last rooster spawned
            roostQueueTime = 7; //time between rooster spawning
            roosterQueue = 0;

            //chicken
            numChic = 1; //initial number of chickens
            maxChicken = 10; //max number of chickens
            chickenTime = 0f; //tracks number of seconds since last chicken spawned
            chicQueueTime = 7f; //time between chicken spawning
            chickenQueue = 0;

            //egg values
            eggCount = 0; //number of eggs caught by Character
            numEgg = 0;

            //broken egg
            numBrokeEgg = 0; //number of broken eggs on ground
            brokenEggDisappear = 30.0f;  // time for broken egg to disappear
            brokenEggTime = 0.0f;

            //day timer
            days = 0;           //tracks number of total days5
            dayTime = 0; //tracks number of seconds since day began
            endDay = 500; //day ends when dayTime equals endDay /180 default value
            timedGoalEnd = 30;
            timedGoalCurrent = 0;
            endOfDay = false;

            //boots
            numBoots = 0;
            bootTime = 0.0f; //tracks time since last boot spawned
            bootWaitTime = 10.0f; //time between spawns (when bootSpawnTime equals bootWaitTime add boots)
            bootDeleteTime = 30.0f; //time that boot will disappear
            bootPresent = false; //shows if there is a boot spawned
            bootsEquipped = false; // shows if player has picked up boots
            equippedTime = 0.0f; //tracks time since boots were Equipped
            maxEquipTime = 30.0f;

            //hotkey
            buttonCheck = false;
            buttonCheck2 = false;

            // base.Initialize();
        }
Exemple #2
0
 public void addEggShadow(Vector3 chickenPosition)
 {
     shadowList[numEgg] = new EggShadowClass(content, graphics);
     shadowList[numEgg].position = chickenPosition;
     shadowList[numEgg].position.Y = 185f;
 }