public Laser(int x, int y, Lasers lasers) { ellipse = new Ellipse(); ellipse.Fill = new SolidColorBrush(Colors.Black); X = x; Y = y; Width = 5; Height = 10; stepSize = 1; this.lasers = lasers; lasers.Add(this); }
public Game() { InitializeComponent(); user = new User(); user.DisplayOn(gameCanvas); alien = new Alien(); alien.DisplayOn(gameCanvas); lasers = new Lasers(); bombs = new Bombs(); animationTimer = new DispatcherTimer(); animationTimer.Interval = TimeSpan.FromMilliseconds(50); animationTimer.Tick += animationTimer_Tick; animationTimer.IsEnabled = true; bombTimer = new DispatcherTimer(); bombTimer.Interval = TimeSpan.FromSeconds(2); bombTimer.Tick += bombTimer_Tick; bombTimer.IsEnabled = true; }
public void CheckHit(Lasers lasers) { lasers.CheckHit(this); }