Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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;
        }