Пример #1
0
        //----------------------------------------------------------------------->>CONSTRUCTOR<<
        public Island(int x, int y, int width, int height, Texture2D image): base(new Rectangle(x, y, width, height))
        {
            this.image = image;

            //initialize enum
            type = ObjectType.island;

            //initialize inventory
            this.inventory = new Inventory();
        }
Пример #2
0
        public Player(String name, Rectangle rect)
            : base(rect)
        {
            this.name = name;
            docked = true;
            fuel = 100f;
            health = 100f;
            currency = 50;
            crew = 5;
            inventory = new Inventory();
            this.image = null;
            rand = new Random();
            objList = new List<Object>();
            idle = false;
            direction = Directions.left;
            dockedIsland = null;

            //initialize enum
            type = ObjectType.player;

            //add starting items to inventory
            inventory.AddItem(Inventory.harpoon, 5);
            inventory.AddItem(Inventory.cage, 5);
            inventory.AddItem(Inventory.net, 5);
        }