Esempio n. 1
0
        public List <BulletView> AddBulletViews(Panel p_Map)
        {
            List <BulletView> listViewBullet = new List <BulletView>();

            for (int i = 0; i < gameModel.listBullet.Count; i++)
            {
                BulletView viewBullet = new BulletView(p_Map);
                viewBullet.Model         = gameModel.listBullet[i];
                viewBullet.Model.MapSize = new Point(p_Map.Width, p_Map.Height);
                viewBullet.Subscribe();
                listViewBullet.Add(viewBullet);
            }
            return(listViewBullet);
        }
Esempio n. 2
0
        public BulletView AddBullet(DynamicMapObject entity, Panel p_Map)
        {
            Rectangle rect   = new Rectangle();
            var       bullet = new Bullet(rect.Location, (int)GameForm.paramsGame["speedBullet"]);

            bullet.IdentifyDirection(entity.DirectionNow);
            bullet.entity = entity;
            gameModel.listBullet.Add(bullet);

            BulletView viewBullet = new BulletView(p_Map);

            viewBullet.Model          = bullet;
            viewBullet.Model.Position = new Point(entity.Position.X, entity.Position.Y);
            viewBullet.Model.MapSize  = new Point(p_Map.Width, p_Map.Height);
            viewBullet.Subscribe();

            return(viewBullet);
        }