示例#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);
        }