Ejemplo n.º 1
0
        internal void SetPosition(Ship s)
        {
            double x = s.Position.X + (s.Participant.Width -  Utility.BULLET_SIZE) / 2;
            double y = s.Position.Y - Utility.BULLET_SIZE;

            _position = new Point(x, y);
        }
Ejemplo n.º 2
0
        public void Initialize() 
        {
            _screen = new Screen(_canvas);
            _screen.Clear();

            var shipPosition = new Point(Utility.MARGIN, Utility.MAX_Y);
            _ship = new Ship(shipPosition, _canvas);
            _ship.Fire = FireBullet;
            _screen.Add(_ship.Render());

            var invaderPosition = new Point(Utility.MARGIN, Utility.MARGIN);
            var invaderDirection = new Point(Utility.ATOM_SIZE, Utility.ATOM_SIZE * 3);
            _invader = new Invader(invaderPosition, invaderDirection);
            _screen.Add(_invader.Render());

            _bullet = new Bullet();
            _bullet.Remove = RemoveBullet;

            _screen.AddBorder();
        }