/// <summary> /// Erstellt ein Item, am oberen Formrand an einer Zufälligen X-Koordinate /// </summary> private void Cretate() { Destoryed = false; X = RandomUtil.Generate(0, _game.ContainerWidth); if (_rectItem.IsEmpty) { _rectItem = _graphicUtil.CreateRectangle(X, Y, Width, Height); } _rectItem.Y = Y; _rectItem.X = X; _intervalTimer.Restart(); _interval = GenerateInterval(); _graphicUtil.FillRectangle(_rectItem, _itemColor); }
/// <summary> /// Lässt bei dem Raumschiff eine Kugel erscheinen /// </summary> private void CreateSpaceShipBullet() { var y = _game.SpaceShipLocationY; var x = _game.SpaceShipLocationX + (_game.SpaceShipWidth / 2 - 5); _rectBullet = _graphicUtil.CreateRectangle(x, y, Width, Height); _graphicUtil.FillRectangle(_rectBullet, Color.Green); }
private void CreateMid() { _invader = new Rectangle[12]; var blocWidth = Width * 2; var blocHeight = Height * 5; _invader[0] = _graphicUtil.CreateRectangle(X, Y, blocWidth, blocHeight); _graphicUtil.FillRectangle(_invader[0], Color.Red); CreateLeftEye(); }
/// <summary> /// Erstellt einen Stein /// </summary> public void Create(int x, int y) { _recRock = _graphicUtil.CreateRectangle(x, y, Width, Hight); _graphicUtil.FillRectangle(_recRock, _color); }
/// <summary> /// Erstellt die Mitte des Invaders /// </summary> private void CreateMid() { _invader = new Rectangle[13]; const int blocWidth = BlocWidth * 2; const int blocHeight = BlocHeight * 5; _invader[0] = _graphicUtil.CreateRectangle(X, Y, blocWidth, blocHeight); _graphicUtil.FillRectangle(_invader[0], _color); }