Пример #1
0
 public Player(playerBin aTrashBin, playerBin aRecycleBin)
 {
     _TrashBin = aTrashBin;
     _ReycleBin = aRecycleBin;
 }
Пример #2
0
        protected override void LoadContent()
        {
            _spriteBatch = new SpriteBatch(GraphicsDevice);
            _gameBoundaries = new Rectangle(0, 0, Window.ClientBounds.Width, Window.ClientBounds.Height);

            // Abstract to Level Defined Method or some ish.....

            var random = new Random();

            var trashItem1Texture = Content.Load<Texture2D>("trash1");
            var trashItemLocation = new Vector2(_gameBoundaries.Width / 2 - random.Next(-800, 1000), 0f);
            var trashItem1 = new trashItem(trashItem1Texture, trashItemLocation, _gameBoundaries);
            trashItem1.setTrashType(TrashType.Trash);

            var recycleItem1Texture = Content.Load<Texture2D>("recycle1");
            var recylceItemLocation = new Vector2(_gameBoundaries.Width / 2 - random.Next(-1000, 800), 0f);
            var recycleItem1 = new trashItem(recycleItem1Texture, recylceItemLocation, _gameBoundaries);
            recycleItem1.setTrashType(TrashType.Recycle);

            //Abstract to Level Defined Method or some ish.....

            var trashBinTexture = Content.Load<Texture2D>("trashBin");
            var trashBinLocation = new Vector2(_gameBoundaries.Width/2 + 50f, _gameBoundaries.Height - 100f);
            var trashBin = new playerBin(trashBinTexture, trashBinLocation, _gameBoundaries);
            trashBin.setBinType(TrashType.Trash);

            var recycleBinTexture = Content.Load<Texture2D>("recycleBin");
            var recycleBinLocation = new Vector2(_gameBoundaries.Width/2 - 50f, _gameBoundaries.Height - 100f);
            var recycleBin = new playerBin(recycleBinTexture, recycleBinLocation, _gameBoundaries);
            recycleBin.setBinType(TrashType.Recycle);

            var iconTexture = new Texture2D(GraphicsDevice, 100, 100);
            iconTexture = Content.Load<Texture2D>("RecyCloneIcon");
            var icon = new Icon(iconTexture, Vector2.Zero, _gameBoundaries);

            // Score Creation
            var spriteFontTexture = Content.Load<SpriteFont>("font");
            var score = new Score(spriteFontTexture, _gameBoundaries);

            _gameObjects = new gameObjects();
            _gameObjects.TrashBin = trashBin;
            _gameObjects.RecycleBin = recycleBin;
            _gameObjects.Score = score;
            _gameObjects.Icon = icon;
            _gameObjects.trashItem1 = trashItem1;
            _gameObjects.recycleItem1 = recycleItem1;
            _gameObjects.Score = score;
        }