public ObjEnemyOne(World world, ObjPlayer player) : base(world) { MoveToRandom(); Width = 80; Height = 48; Sprite = new RenctangleSprite(new SolidColorBrush(Color.FromRgb(0, 255, 0)), Width, Height); this.player = player; bullets.Add(new CircleNormalBulleter(this)); bullets.Add(new GuidedBulleter(this, player)); dispancer = new DispatcherTimer(); dispancer.Interval = TimeSpan.FromMilliseconds(600); dispancer.Tick += delegate { int bulletIndex = rand.Next(0, bullets.Count); double wait = bullets[bulletIndex].Shoot(); dispancer.Interval = TimeSpan.FromMilliseconds(wait); }; dispancer.Start(); }
public ObjOwnBullet(World world, double X, double Y) : base(world) { this.X = X; this.Y = Y; Width = 3; Height = 15; Sprite = new RenctangleSprite(new SolidColorBrush(Color.FromRgb(255, 50, 220)), Width, Height); }
public ObjPlayer(World world) : base(world) { X = Math.Round(world.Width / 2); Y = world.Height - 50; Width = 14; Height = 14; Sprite = new RenctangleSprite(new SolidColorBrush(Color.FromRgb(255, 50, 50)), Width, Height); ScoreManager = new ScoreManager(); ScoreManager.Comboed += ScoreManager_Comboed; ScoreManager.Dieded += ScoreManager_Dieded; }