Ejemplo n.º 1
0
        public AllGui(Camera cam, MainPlayer will, Texture2D hud, Texture2D trans, Texture2D charactersForHud
                                                                   , Texture2D titleScreen, Texture2D menuScreen, Texture2D life
                                                                   , Texture2D selectionScreen, Texture2D playerMenu,Texture2D transBack)
        {
            //initiate the camera and the position, place texture and have title screen and menu
            this.life = life;
            this.cam = cam;
            this.titleScreen = titleScreen;
            this.trans = trans;
            this.characters = charactersForHud;
            this.playerGui = hud;
            this.menuStuff = menuScreen;
            this.selectionScreen = selectionScreen;
            this.playerMenu = playerMenu;
            this.transBack = transBack;

            //This is the source rectangle to do the transformation animations
            sourceRect = new Rectangle(0, 0, 71 * 2, 71 * 2);

            //These lines set up the images that are to be drawn on the selection screen
            pressEnterTextSource = new Rectangle(6, 10, 420, 30);
            loadSaveBoxSource = new Rectangle(261, 50, 728, 192);
            loadSaveBox2Source = new Rectangle(261, 255, 728, 192);
            fingerSource = new Rectangle(18, 320, 48, 40);
            newGameSource = new Rectangle(18, 52, 172, 48);
            loadGameSource = new Rectangle(18, 112, 192, 48);
            optionsSource = new Rectangle(18, 241, 172, 48);
            testRoomSource = new Rectangle(18, 176, 192, 48);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            rand = new Random();
            mediaPlayer = new MediaPlayerGaia();
            soundPlayer = new SoundPlayerGaia();

            //Load the main player
            player = new MainPlayer(Content.Load<Texture2D>("Sprites/Will"),Content.Load<Texture2D>("Sprites/WillAttackingSheet")
                                     ,Content.Load<Texture2D>("Sprites/freedan"),null,new Vector2(160, 120),64,84);
            skeleton = new Enemy(20, 5, 4, new Vector2(60, 50), 72, 120, false, Content.Load<Texture2D>("Sprites/Enemy/Skeleton"),true,rand,false);
            bat = new Enemy(14,9, 3, new Vector2(70, 70), 80, 80, true, Content.Load<Texture2D>("Sprites/Enemy/Bat"),true,rand,false);
            powerHitter= new Enemy(100, 20, 25, new Vector2(700, 300), 72, 120, false, Content.Load<Texture2D>("Sprites/Enemy/Skeleton"), true, rand,false);
            lance = new Enemy(10, 10, 10, new Vector2(600, 200), 64, 64, false, Content.Load<Texture2D>("Sprites/NPC/NPCSheet"), true, rand,true);
            //startUpMapBuilder
            mapDesigner = new MapReader(Content.Load<Texture2D>("Maps/GTILES32"));
            //This tells the camera to follow the player as well as setting up the camera
            cam = new Camera(graphics.GraphicsDevice.Viewport, Vector2.Zero);
            cam.Follow(player);

            //load font and set position
            informFont = Content.Load <SpriteFont>("Text2");
            informFont2 = Content.Load<SpriteFont>("Text");

            mediaPlayer.init(Content);
            soundPlayer.init(Content);

            //Load first level
            mapDesigner.init();
            mapDesigner.buildMap("Content/Maps/level",0);

            //Connect the map to the main player and temporary enemies
            player.connectMap(mapDesigner,rand,soundPlayer);
            skeleton.connectMap(mapDesigner,cam,soundPlayer);
            bat.connectMap(mapDesigner,cam,soundPlayer);
            powerHitter.connectMap(mapDesigner,cam,soundPlayer);
            lance.connectMap(mapDesigner, cam,soundPlayer);
            enemyHolder[0] = skeleton;
            enemyHolder[1] = bat;
            enemyHolder[2] = powerHitter;

            //sets the game state to opening screen
            //stats - '0' for title
            //        '1' for openingScreen
            //        '2' for player menu
            gameState = 0;
            lance.addText("Hello there, this is just a test to make sure that NPC is ");
            lance.addText("working correctly. This is another test run because ");
            lance.addText("we will be reading line by line or max characters. Not ");
            lance.addText("100% sure what will be done with this yet");
            lance.color = Color.LightGreen;
            lance.textBox = Content.Load<Texture2D>("Sprites/Gui/TextBox");
            //sets up the Hud and all the graphics any menu
            allGui = new AllGui(cam, player, Content.Load<Texture2D>("Sprites/Gui/PlayerGui")
                                                  , Content.Load<Texture2D>("Sprites/Gui/Transformation2")
                                                  , Content.Load<Texture2D>("Sprites/Gui/characters2"),
                                                  Content.Load<Texture2D>("Sprites/Gui/TitleScreen"),
                                                  Content.Load<Texture2D>("Sprites/Gui/IntroScreenSetup")
                                                  , Content.Load<Texture2D>("Sprites/Gui/life")
                                                  , Content.Load<Texture2D>("Sprites/Gui/SelectionScreen"),
                                                  Content.Load<Texture2D>("Sprites/Gui/PlayerMenu")
                                                  ,Content.Load<Texture2D>("Sprites/Gui/transitionBackground"));

            allGui.connect(soundPlayer,Content.Load<SpriteFont>("Text"),mapDesigner);

            // TODO: use this.Content to load your game content here
        }
Ejemplo n.º 3
0
 //have the enemy be able to access the map
 public void connectMap(MapReader map,Camera cam,SoundPlayerGaia sound)
 {
     this.mapDesign = map;
     this.cam = cam;
     this.sound = sound;
 }