Пример #1
0
 //contructor(s)
 public Mechanic(Texture2D texture, Vector2 position, RoomE room, Resources resource, string name, int animWidth, int animHeight, int maxFrames, int spritesPerRow, Button button1, Button button2, Button button3, Button button4, Texture2D walkLeft, int walkLeftFrames, int walkLeftSPR, Texture2D walkRight, int walkRightFrames, int walkRightSPR,
     Texture2D walkUp, int walkUpFrames, int walkUpSPR, Texture2D walkDown, int walkDownFrames, int walkDownSPR, int intel, int perc, int stam, int con, int hand, int hunger, string wName, Texture2D portrait, Texture2D deathAnim, Texture2D deadTexture)
     : base(texture, position, room, name, animWidth, animHeight, maxFrames, spritesPerRow, button1, button2, button3, button4, walkLeft, walkLeftFrames, walkLeftSPR, walkRight, walkRightFrames, walkRightSPR, walkUp, walkUpFrames, walkUpSPR, walkDown, walkDownFrames, walkDownSPR, intel, perc, stam, con, hand, hunger)
 {
     this.WrenchName = wName;
     this.Resource = resource;
     this.healthPoints = (con * 2) * 10;
     this.OldPos = position;
     this.OldTexture = texture;
     this.OldSPR = spritesPerRow;
     this.OldFrames = maxFrames;
     this.Portrait = portrait;
     this.DeathAnim = deathAnim;
     this.DeadTexture = deadTexture;
 }
Пример #2
0
        //constructor(s)
        protected Character(Texture2D texture, Vector2 position, RoomE room, string name, int animWidth, int animHeight, int maxFrames, int spritesPerRow,
            Button button1, Button button2, Button button3, Button button4, Texture2D walkLeft, int walkLeftFrames, int walkLeftSPR, Texture2D walkRight, int walkRightFrames, int walkRightSPR,
            Texture2D walkUp, int walkUpFrames, int walkUpSPR, Texture2D walkDown, int walkDownFrames, int walkDownSPR, int intel, int perc, int stam, int con, int hand, float hunger)
        {
            this.Texture = texture;
            this.Position = position;
            this.RoomV = room;
            this.CharName = name;
            this.AnimHeight = animHeight;
            this.AnimWidth = animWidth;
            this.MaxFrames = maxFrames;
            this.SpritesPerRow = spritesPerRow;
            this.CharButton1 = button1;
            this.CharButton2 = button2;
            this.CharButton3 = button3;
            this.CharButton4 = button4;
            this.WalkLeft = walkLeft;
            this.WalkLeftFrames = walkLeftFrames;
            this.WalkLeftSpritesPerRow = walkLeftSPR;
            this.WalkRight = walkRight;
            this.WalkRightFrames = walkRightFrames;
            this.WalkRightSpritesPerRow = walkRightSPR;
            this.WalkUpFrames = walkUpFrames;
            this.WalkUp = walkUp;
            this.WalkUpSpritesPerRow = walkUpSPR;
            this.WalkDown = walkDown;
            this.WalkDownFrames = walkDownFrames;
            this.WalkDownSpritesPerRow = walkDownSPR;

            this.Intellect = intel;
            this.Perception = perc;
            this.Stamina = stam;
            this.Constitution = con;
            this.Handyness = hand;
            this.Hunger = hunger;
        }
Пример #3
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here
            clock = new DateTime();

            tab1Texture = Content.Load<Texture2D>("Tab Button Engineroom");
            tab2Texture = Content.Load<Texture2D>("Tab Button Infirmary");
            tab3Texture = Content.Load<Texture2D>("Tab Button Kitchen");

            b = new BackScroll(Content.Load<Texture2D>("space02"), Content.Load<Texture2D>("space03"), .03f);
            background = Content.Load<Texture2D>("background12");
            menu = Content.Load<Texture2D>("menu_layout");
            preStartScreen = new Button(Content.Load<Texture2D>("start00"), new Vector2(0,0), Color.White, ButtonName.Default);
            introScreen = Content.Load<Texture2D>("Intro");

            startButton = new Button(Content.Load<Texture2D>("Start Button"), new Vector2(GraphicsDevice.Viewport.Width - 300, 50), Color.White, ButtonName.Start);
            creditsButton = new Button(Content.Load<Texture2D>("Start Button"), new Vector2(GraphicsDevice.Viewport.Width - 300, 350), Color.White, ButtonName.Credits);
            quitButton = new Button(Content.Load<Texture2D>("Start Button"), new Vector2(GraphicsDevice.Viewport.Width - 300, 650), Color.White, ButtonName.Quit);

            elevator = new ForegroundObject(Content.Load<Texture2D>("elevator_002"), new Vector2(352, 264), 500, 500, 13, 4, 100);
            radar = new ForegroundObject(Content.Load<Texture2D>("radartech01"), new Vector2(1010, 420), 350, 100, 4, 2, 100);
            screen = new ForegroundObject(Content.Load<Texture2D>("screen01"), new Vector2(990, 140), 350, 300, 2, 2, 100);
            loseScreen = new ForegroundObject(Content.Load<Texture2D>("end_screen02"), new Vector2(0, 0), 1600, 900, 2, 2, 100);

            Characters = new List<Character>();

            this.IsMouseVisible = true;

            spaceBackground = Content.Load<Texture2D>("Space BG");
            
            base.Initialize();

            RoomTabs = new List<RoomTab>();
            RoomTextures = new List<Texture2D>();

            resource = new Resources(Content.Load<Texture2D>("resource_button"), new Vector2(2, 18), testFont, spriteBatch, 200, 300, 100, 3000, 100);

            buttonList = new List<Button>();

            victoryTexture = Content.Load<Texture2D>("victory_00");
            victoryPos = new Vector2(-1000, 0);
            
            //Setting graphics settings
            graphics.PreferredBackBufferWidth = 1600;
            graphics.PreferredBackBufferHeight = 900;
            graphics.IsFullScreen = true;
            graphics.ApplyChanges();
            rand = new Random();
            //Initializing characters
            spencer = new Mechanic(Content.Load<Texture2D>("spencer_idle_04"), new Vector2(1100, 400), RoomE.Bridge, resource, "Spencer Bara", 300, 300, 3, 2, new Button(Content.Load<Texture2D>("button"), new Vector2(400, 665), Color.White, ButtonName.Eat),
                new Button(Content.Load<Texture2D>("button"), new Vector2(850, 665), Color.White, ButtonName.Resolve), new Button(Content.Load<Texture2D>("button"), new Vector2(400, 790), Color.White, ButtonName.Heal), new Button(Content.Load<Texture2D>("button")
                    , new Vector2(850, 790), Color.White, ButtonName.Upgrade), Content.Load<Texture2D>("spencer_walk_left_00"), 8, 3, Content.Load<Texture2D>("spencer_walk_right_01"), 8, 3, Content.Load<Texture2D>("spencer_walk_up_04"), 8, 3, Content.Load<Texture2D>("spencer_walk_down_05"), 8, 3,
                    5, 5, 5, 5, 5, 100, "", Content.Load<Texture2D>("Portrait Spencer"), Content.Load<Texture2D>("Spencer Dead"), Content.Load<Texture2D>("Spencer dead still"));

            spencer.ID = 4;

            lavender = new Mechanic(Content.Load<Texture2D>("Lavender_Idle"), new Vector2(500, 400), RoomE.Bridge, resource, "Lavender Flowers", 174, 300, 10, 5, new Button(Content.Load<Texture2D>("button"), new Vector2(400, 665), Color.White, ButtonName.Eat),
                new Button(Content.Load<Texture2D>("button"), new Vector2(850, 665), Color.White, ButtonName.Resolve), new Button(Content.Load<Texture2D>("button"), new Vector2(400, 790), Color.White, ButtonName.Heal), new Button(Content.Load<Texture2D>("button")
                    , new Vector2(850, 790), Color.White, ButtonName.Upgrade), Content.Load<Texture2D>("lavender walk left"), 8, 5, Content.Load<Texture2D>("lavender walk right"), 8, 5, Content.Load<Texture2D>("Lavender Walk Back"), 8, 5, Content.Load<Texture2D>("Lavender Walk Front"), 8, 5,
                    5, 5, 5, 5, 5, 100, "", Content.Load<Texture2D>("Portrait Lavender"), Content.Load<Texture2D>("Lavender Dead"), Content.Load<Texture2D>("Lavender dead still"));
            lavender.ID = 5;

            dora = new Mechanic(Content.Load<Texture2D>("Dora Hairflip"), new Vector2(700, 400), RoomE.Bridge, resource, "Dora \"the Explorah\" Dandy", 174, 300, 13, 5, new Button(Content.Load<Texture2D>("button"), new Vector2(400, 665), Color.White, ButtonName.Eat),
                new Button(Content.Load<Texture2D>("button"), new Vector2(850, 665), Color.White, ButtonName.Resolve), new Button(Content.Load<Texture2D>("button"), new Vector2(400, 790), Color.White, ButtonName.Heal), new Button(Content.Load<Texture2D>("button")
                    , new Vector2(850, 790), Color.White, ButtonName.Upgrade), Content.Load<Texture2D>("Dora Walk Left"), 8, 5, Content.Load<Texture2D>("Dora Walk Right"), 8, 5, Content.Load<Texture2D>("Dora Walk Back"), 8, 5, Content.Load<Texture2D>("Dora Walk Front"), 8, 5,
                    5, 5, 5, 5, 5, 100, "", Content.Load<Texture2D>("Portrait Dora"), Content.Load<Texture2D>("Dora Dead"), Content.Load<Texture2D>("Dora dead still"));

            dora.ID = 3;

            mechanic = new Mechanic(Content.Load<Texture2D>("Kitty Breath Blink"), new Vector2(1000, 450), RoomE.Bridge, resource, "Kitty Kat", 174, 300, 9, 5, new Button(Content.Load<Texture2D>("button"), new Vector2(400, 665), Color.White, ButtonName.Eat),
                new Button(Content.Load<Texture2D>("button"), new Vector2(850, 665), Color.White, ButtonName.Resolve), new Button(Content.Load<Texture2D>("button"), new Vector2(400, 790), Color.White, ButtonName.Heal), new Button(Content.Load<Texture2D>("button")
                    , new Vector2(850, 790), Color.White, ButtonName.Upgrade), Content.Load<Texture2D>("Kitty Walk Left"), 8, 5, Content.Load<Texture2D>("Kitty Walk Right"), 8, 5, Content.Load<Texture2D>("Kitty Walk Back"), 9, 5, Content.Load<Texture2D>("Kitty Walk Front"),
                    9, 5, 5, 5, 5, 8, 5, 100, "Olaf", Content.Load<Texture2D>("Portrait Kitty"), Content.Load<Texture2D>("Kitty Dead"), Content.Load<Texture2D>("Kitty dead still"));

            mechanic.ID = 1;

            mechanic2 = new Mechanic(Content.Load<Texture2D>("idle_pose02"), new Vector2(300, 450), RoomE.Bridge, resource, "Blondie Bubs", 300, 300, 8, 3, new Button(Content.Load<Texture2D>("button"), new Vector2(400, 665), Color.White, ButtonName.Eat),
                new Button(Content.Load<Texture2D>("button"), new Vector2(850, 665), Color.White, ButtonName.Resolve), new Button(Content.Load<Texture2D>("button"), new Vector2(400, 790), Color.White, ButtonName.Heal), new Button(Content.Load<Texture2D>("button")
                    , new Vector2(850, 790), Color.White, ButtonName.Upgrade), Content.Load<Texture2D>("walk_right_03"), 8, 3, Content.Load<Texture2D>("walk_right_03"), 8, 3, Content.Load<Texture2D>("walk_up_02"), 8, 3, Content.Load<Texture2D>("walk_up_02"), 8, 3,
                    5, 5, 5, 5, 5, 100, "Olaf", Content.Load<Texture2D>("Portrait Blondie"), Content.Load<Texture2D>("Blondie Dead"), Content.Load<Texture2D>("Blondie dead still"));

            mechanic2.ID = 2;

            ListOfChars.statListChar.Add(dora);
            ListOfChars.statListChar.Add(mechanic);
            ListOfChars.statListChar.Add(mechanic2);
            ListOfChars.statListChar.Add(spencer);
            ListOfChars.statListChar.Add(lavender);

            p = new ErrorMessage(mechanic, mechanic2, dora, spencer, lavender, resource);

            //Initializing events
            RoomCamera2 = Content.Load<Texture2D>("Engineroom05");
            RoomCamera3 = Content.Load<Texture2D>("infirmary003");
            RoomCamera4 = Content.Load<Texture2D>("kitchen_02");
            RoomTextures.Add(RoomCamera2);
            RoomTextures.Add(RoomCamera3);
            RoomTextures.Add(RoomCamera4);
            roomTab2 = new RoomTab(tab1Texture, new Vector2(1500, 150), "engineRoom", RoomE.EngineRoom, RoomCamera2);
            roomTab3 = new RoomTab(tab2Texture, new Vector2(1500, 250), "Infirmary", RoomE.Infirmary, RoomCamera3);
            roomTab4 = new RoomTab(tab3Texture , new Vector2(1500, 350), "Kitchen", RoomE.Kitchen, RoomCamera4);
            RoomTabs.Add(roomTab2);
            RoomTabs.Add(roomTab3);
            RoomTabs.Add(roomTab4);
           
            //Initializing variables
            maxEvents = 5;
        }