public void shoot(mainHero hero) { if (shooting_bullet) { this.y -= speed; if (this.y < -1500) { startPosition(hero); } } }
private void startBtn_Click(object sender, EventArgs e) { if (name != "LMAOOOOOOOOOOOOOOOOOOOOOOOOOOO!@#!@#") { menuBtn.Hide(); startBtn.Hide(); timer1.Enabled = true; Doodle = new mainHero(); Doodle.x = (gameWindow.Width / 2) - Doodle.width; Doodle.y = (gameWindow.Height / 2) - (Doodle.height * 2); score = 0; for (int i = 0; i < Bricks.Length; i++) { Bricks[i] = new Brick(); } for (int i = 0; i < Clouds.Length; i++) { Clouds[i] = new Cloud(); } Bricks[0].y = Doodle.y + 30; Bricks[0].x = Doodle.x; for (int i = 1; i < Bricks.Length; i++) { Bricks[i].moveBrick(Bricks[i - 1]); } for (int i = 1; i < Clouds.Length; i++) { Clouds[i].moveBrick(Clouds[i - 1]); } } else { MessageBox.Show("Сначала имя введи дурачок"); } }
public void startPosition(mainHero hero) { this.x = hero.x + (hero.width / 2); this.y = hero.y; this.shooting_bullet = false; }
public Bullet(mainHero hero) { startPosition(hero); }