示例#1
0
        private void CreatePointCharge(float x, float y, PointChargeType type)
        {
            PointCharge p = PointCharge.GetPointCharge(type);

            p.XPosition = x;
            p.YPosition = y;

            p.InitialX = x;
            p.InitialY = y;

            _score -= 10;

            p.Bitmap = _pointChargeBitmaps[p.BmpID];

            _activeGameObjects.Add(p);
            _activePointCharges.Add(p);
        }
        public static PointCharge GetPointCharge(PointChargeType type)
        {
            List <PointChargeDef> defs = new List <PointChargeDef>();

            foreach (PointChargeDef pd in pointChargeDefs)
            {
                if (pd._type == type)
                {
                    defs.Add(pd);
                    break;
                }
            }

            PointCharge p = new PointCharge(defs[0]);

            p.XAcceleration = 0;
            p.XVelocity     = 0;
            p.YAcceleration = 0;
            p.YVelocity     = 0;

            return(p);
        }