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();
        }
Beispiel #2
0
        public TanmakWorld(GamePlane Plane) : base(Plane)
        {
            ObjPlayer       = new ObjPlayer(this);
            ObjEnemyCreater = new ObjEnemyCreater(this, ObjPlayer);

            Objects.Add(ObjPlayer);
            Objects.Add(ObjEnemyCreater);
        }
Beispiel #3
0
 public ObjEnemyCreater(World world, ObjPlayer player) : base(world)
 {
     world.AddObject(new ObjEnemyOne(world, player));
 }