コード例 #1
0
        public Enemy(Vector2 position, Player play, int MapID)
            : base(position, "Enemy")
        {
            FramesPerSecond = 10;
          
            //Adds all the players animations
            AddAnimation(12, 0, 0, "Down", 50, 50, new Vector2(0, 0));
            AddAnimation(1, 0, 0, "IdleDown", 50, 50, new Vector2(0, 0));
            AddAnimation(12, 50, 0, "Up", 50, 50, new Vector2(0, 0));
            AddAnimation(1, 50, 0, "IdleUp", 50, 50, new Vector2(0, 0));
            AddAnimation(8, 100, 0, "Left", 50, 50, new Vector2(0, 0));
            AddAnimation(1, 100, 0, "IdleLeft", 50, 50, new Vector2(0, 0));
            AddAnimation(8, 100, 8, "Right", 50, 50, new Vector2(0, 0));
            AddAnimation(1, 100, 8, "IdleRight", 50, 50, new Vector2(0, 0));
            AddAnimation(9, 150, 0, "AttackDown", 70, 80, new Vector2(0, 0));
            AddAnimation(9, 230, 0, "AttackUp", 70, 80, new Vector2(-13, -27));
            AddAnimation(9, 310, 0, "AttackLeft", 70, 70, new Vector2(-30, -5));
            AddAnimation(9, 380, 0, "AttackRight", 70, 70, new Vector2(+15, -5));
            //Plays our start animation
            PlayAnimation("IdleDown");
            player = play;
            HitBox = new Rectangle((int)sPostion.X - 45, (int)sPostion.Y - 45, 90, 90);
            Map = MapID;
            combatHandler = Main.game.combatHandler;
            //

        }
コード例 #2
0
        public Butterfly(Vector2 position, Player play)
            : base(position, "Butterfly")
        {
            FramesPerSecond = 10;
            //Adds all the players animations
            AddAnimation(12, 0, 0, "Down", 50, 50, new Vector2(0, 0));
            AddAnimation(1, 0, 0, "IdleDown", 50, 50, new Vector2(0, 0));
            AddAnimation(12, 50, 0, "Up", 50, 50, new Vector2(0, 0));
            AddAnimation(1, 50, 0, "IdleUp", 50, 50, new Vector2(0, 0));
            AddAnimation(8, 100, 0, "Left", 50, 50, new Vector2(0, 0));
            AddAnimation(1, 100, 0, "IdleLeft", 50, 50, new Vector2(0, 0));
            AddAnimation(8, 100, 8, "Right", 50, 50, new Vector2(0, 0));
            AddAnimation(1, 100, 8, "IdleRight", 50, 50, new Vector2(0, 0));
            AddAnimation(9, 150, 0, "AttackDown", 70, 80, new Vector2(0, 0));
            AddAnimation(9, 230, 0, "AttackUp", 70, 80, new Vector2(-13, -27));
            AddAnimation(9, 310, 0, "AttackLeft", 70, 70, new Vector2(-30, -5));
            AddAnimation(9, 380, 0, "AttackRight", 70, 70, new Vector2(+15, -5));
     
            //Plays our start animation
            PlayAnimation("IdleDown");
            player = play;
           HitBox = new Rectangle((int)sPostion.X - 100, (int)sPostion.Y - 100, 280, 280);
            //

        }
コード例 #3
0
        public int NPC_Location = 0; //Map ID of the NPC

        public WoodChopper(Vector2 position)
            : base(position, "Lumberjack Brock")
        {
            FramesPerSecond = 10;
            //Adds all the players animations
            AddAnimation(12, 0, 0, "Down", 50, 50, new Vector2(0, 0));
            AddAnimation(1, 0, 0, "IdleDown", 50, 50, new Vector2(0, 0));
            AddAnimation(12, 50, 0, "Up", 50, 50, new Vector2(0, 0));
            AddAnimation(1, 50, 0, "IdleUp", 50, 50, new Vector2(0, 0));
            AddAnimation(8, 100, 0, "Left", 50, 50, new Vector2(0, 0));
            AddAnimation(1, 100, 0, "IdleLeft", 50, 50, new Vector2(0, 0));
            AddAnimation(8, 100, 8, "Right", 50, 50, new Vector2(0, 0));
            AddAnimation(1, 100, 8, "IdleRight", 50, 50, new Vector2(0, 0));
            AddAnimation(9, 150, 0, "AttackDown", 70, 80, new Vector2(0, 0));
            AddAnimation(9, 230, 0, "AttackUp", 70, 80, new Vector2(-13, -27));
            AddAnimation(9, 310, 0, "AttackLeft", 70, 70, new Vector2(-30, -5));
            AddAnimation(9, 380, 0, "AttackRight", 70, 70, new Vector2(+15, -5));
            //Plays our start animation
            PlayAnimation("IdleDown");
            player = Main.game.player;
            HitBox = new Rectangle((int)sPostion.X, (int)sPostion.Y, 64, 64);

            Dialogue = Main.game.Dialogue;

            Original_Position = position;

        }
コード例 #4
0
        public scene()
        {
            Map_Area = new Rectangle(0, 0, 910, 560);
            Lumbridge_Texture = Main.game.Content.Load<Texture2D>("Images/UI_Textures/UI_Buttons/Quest_Icon_PH");
            test_Texture = Main.game.Content.Load<Texture2D>("Images/UI_Textures/UI_Buttons/Music_Icon_PH");
            Background = Main.game.Content.Load<Texture2D>("Images/solidred");
            Green_Dot = Main.game.Content.Load<Texture2D>("Images/Green_Dot");

            floor[0] = Main.game.Content.Load<Texture2D>("Tiles/Grass_Tile");
            floor[1] = Main.game.Content.Load<Texture2D>("Tiles/Grass_Tile");
            floor[2] = Main.game.Content.Load<Texture2D>("Tiles/Grass_Tile");
            floor[3] = Main.game.Content.Load<Texture2D>("Tiles/Grass_Tile");
            floor[4] = Main.game.Content.Load<Texture2D>("Tiles/Grass_Tile");
            player = Main.game.player;
            portal = new Portal(this);
            content();
            Load_Farm_Content();
            Load_Something_Content(2);
            Load_Something_Content(3);
            Load_Something_Content(4);

            Setup_Walkable_Tiles();

            Tree_Handlers = new WoodcuttingHandler[1];
            Load_Map("Map0", 0);
            Load_Map("Map1", 1);
            Load_Map("Map2", 2);
            Load_Map("Map3", 3);
            Load_Map("Map4", 4);
        }
コード例 #5
0
 public LocationHandler(ContentManager cont, Player play)
 {
     Content = cont; //Assign content to the passed in content manager object
     player = play; //Assign player to the passed in player object
     music = new MusicHandler(Content); //Initialize the music object and pass in the content and player object
 }