Exemplo n.º 1
0
        // constructor
        public Enemy(Vector3 vel, Animation[] animations, string[] names, Vector3 loc, Rectangle rect, int value, int dir)
            : base(vel, animations, names, loc, rect)
        {
            // sets up commands
            commandQueue = new Queue<ICommand>();
            defaultCommands = new Queue<ICommand>();

            // sets starting location
            startLocation = loc;

            // sets enemy to be unaware of player
            state = AI_STATE.UNAWARE;

            center = new Vector3(rect.X + rect.Width, rect.Y + rect.Height, loc.Z);

            moneyValue = value;
            alive = true;
            direction = dir;

            switch (direction)
            {
                case 0: CurrentAnimation = "StandUp";
                    break;
                case 1: CurrentAnimation = "StandRight";
                    break;
                case 2: CurrentAnimation = "StandDown";
                    break;
                case 3: CurrentAnimation = "StandLeft";
                    break;
            }
        }
        // constructor
        // takes the names and animations and adds them to the anims dictionary
        public DrawableGameObject(Animation[] animations, string[] names, Vector3 loc, Rectangle rect)
            : base(loc, rect)
        {
            anims = new Dictionary<string, Animation>();

            for (int i = 0; i < names.Length; i++)
            {
                anims.Add(names[i], animations[i]);
            }
            CurrentAnimation = "default";
        }
Exemplo n.º 3
0
        // constructor
        public Player(Vector3 velocity, Animation[] animations, string[] names, Vector3 location, Rectangle rectangle, int life, int moneyGoal)
            : base(velocity, animations, names, location, rectangle)
        {
            startLoc = location;

            // not currently used for anything, but will be implemented by next milestone.
            lives = life;
            moneyNeeded = moneyGoal;
            moneyCollected = 0;

            attackLength = 0;

            currentWeapon = null;
            currentDisguise = null;
        }
Exemplo n.º 4
0
        public bool visible; // whether or not to draw the weapon.

        #endregion Fields

        #region Constructors

        public Weapon(Animation[] animations, string[] names, Vector3 location, Rectangle rect, int durable)
            : base(animations, names, location, rect)
        {
            durability = durable;
            visible = true;
        }
Exemplo n.º 5
0
        public Boolean locked; // whether or not it's locked.

        #endregion Fields

        #region Constructors

        public Door(Animation[] animations, string[] names, Vector3 loc, Rectangle rect, int doorNum)
            : base(animations, names, loc, rect)
        {
            locked = true;
            keyAssociation = doorNum;
        }
Exemplo n.º 6
0
        public string disguiseType; // the type of disguise, either Chef, Mechanic, or Box

        #endregion Fields

        #region Constructors

        public Disguise(Animation[] animations, string[] names, Vector3 loc, Rectangle rect, string disguise)
            : base(animations, names, loc, rect)
        {
            disguiseType = disguise;
        }
Exemplo n.º 7
0
        public int doorAssociation; // number that corresponds to an index in the list of locked doors.

        #endregion Fields

        #region Constructors

        public Key(Animation[] animations, string[] names, Vector3 loc, Rectangle rect, int keyNum)
            : base(animations, names, loc, rect)
        {
            doorAssociation = keyNum;
        }
Exemplo n.º 8
0
        private int value; // the amount of money the coin is worth

        #endregion Fields

        #region Constructors

        public Coin(Animation[] animations, string[] names, Vector3 loc, Rectangle rect, int val)
            : base(animations, names, loc, rect)
        {
            value = val;
            active = true;
        }
        public Vector3 velocity; // amount the object moves in a single move method

        #endregion Fields

        #region Constructors

        // constructor
        public MovableGameObject(Vector3 vel, Animation[] animations, string[] names, Vector3 loc, Rectangle rect)
            : base(animations, names, loc, rect)
        {
            velocity = vel;
        }