Beispiel #1
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);
        }