private void CreateBins() { CCGeometryNode node; var gameView = base.GameView; fruitBins = new List <FruitBin>(); // make 2 bins for now: var bin = new FruitBin(); bin.FruitColor = FruitColor.Red; bin.Width = gameView.DesignResolution.Width / 2; bin.PositionY = gameView.DesignResolution.Height - GameCoefficients.collisionHeight; fruitBins.Add(bin); gameplayLayer.AddChild(bin); bin = new FruitBin(); bin.FruitColor = FruitColor.Yellow; // todo: use the screen width to assign this: bin.PositionX = gameView.DesignResolution.Width / 2; bin.PositionY = gameView.DesignResolution.Height - GameCoefficients.collisionHeight; bin.Width = gameView.DesignResolution.Width / 2; fruitBins.Add(bin); gameplayLayer.AddChild(bin); }
private void CreateBins() { CCGeometryNode node; var gameView = base.GameView; fruitBins = new List <FruitBin>(); // make 2 bins for now: var bin = new FruitBin(); bin.FruitColor = FruitColor.Red; bin.Width = gameView.ViewSize.Width / 2; fruitBins.Add(bin); gameplayLayer.AddChild(bin); bin = new FruitBin(); bin.FruitColor = FruitColor.Yellow; // todo: use the screen width to assign this: bin.PositionX = gameView.ViewSize.Width / 2; bin.Width = gameView.ViewSize.Width / 2; fruitBins.Add(bin); gameplayLayer.AddChild(bin); splitter = new SolidRectangle(20, GameCoefficients.SplitterHeight); splitter.PositionX = gameplayLayer.ContentSize.Width / 2.0f; splitter.PositionY = GameCoefficients.SplitterHeight / 2.0f; splitter.Visible = false; gameplayLayer.AddChild(splitter); }
private void CreateBins() { _bins = new List <FruitBin>(); _splitter = new SolidRectangle(20, GameCoefficients.SplitterHeight) { Visible = false }; var redBin = new FruitBin(FruitColor.Red); var yellowBin = new FruitBin(FruitColor.Yellow); _bins.Add(redBin); _bins.Add(yellowBin); AddChild(redBin); AddChild(yellowBin); AddChild(_splitter); }