Пример #1
0
        public bool planting(int x, int y)
        {
            PlantsBox pb = map.Pb;

            if (pb.IsAcitive == false)
            {
                return(false);
            }
            pb.setXY(x - pb.Width / 2, y - pb.Height / 2);

            BoxForPlant bfp = MyAPI.AdjustPonint(x, y);
            Plant       p   = PlantOnLand(bfp, pb.Type);

            //Plant p = pb.Planting();
            if (p == null)
            {
                return(false);
            }
            map.SunShine -= map.SunCost;
            map.addPlant(p);
            map.Pc.loading();//装填弹药
            pb.Destroy();

            return(true);
        }
Пример #2
0
        internal void PlantBoxMove(int x, int y)
        {
            PlantsBox pb = map.Pb;

            if (pb == null || pb.IsAcitive == false)
            {
                return;
            }
            pb.setXY(x - pb.Width / 2, y - pb.Height
                     / 2);
        }
Пример #3
0
        public void initMap()
        {
            //集合组
            plantscards = new ArrayList();
            zombies     = new ArrayList();
            plants      = new ArrayList();
            bullets     = new ArrayList();
            suns        = new ArrayList();
            lands       = new ArrayList();
            cleaners    = new ArrayList();
            //植物临时箱
            pb = new PlantsBox(this);
            cb = new CardsBar(this);

            sunshine = 150;
        }