Esempio n. 1
0
        public DebrisEntity(byte _id, Vector2 projectilePosition, Vector2 originalVelocity, byte _pixelcount, float _scale, TypeOfTexture tot = TypeOfTexture.Projectile)
        {
            Scale = _scale;
            ID    = _id;
            int smallxcoord = (_pixelcount % GameVars.compensatedDebris1DCount);
            int smallycoord = (_pixelcount / GameVars.compensatedDebris1DCount);

            xcoord        = (byte)(GameVars.debrisSize * smallxcoord);
            ycoord        = (byte)(GameVars.debrisSize * smallycoord);
            typeOfTexture = tot;

            velocity.X  = (float)((GameVars.random).NextDouble() - 0.5) * GameVars.RENDERWIDTH / 5;
            velocity.Y  = -(float)((GameVars.random).NextDouble() * 300);
            velocity.X += (originalVelocity.X * 0.5f);
            position    = projectilePosition + new Vector2(xcoord * Scale, ycoord * Scale);
            int temp = GameVars.projectilePixelSize % GameVars.debrisSize;

            if (temp != 0)
            {
                RectMask = new Rectangle(xcoord, ycoord, (smallxcoord == (GameVars.compensatedDebris1DCount - 1))?temp: GameVars.debrisSize, (smallycoord == (GameVars.compensatedDebris1DCount - 1)) ?temp: GameVars.debrisSize);
            }
            else
            {
                RectMask = new Rectangle(xcoord, ycoord, GameVars.debrisSize, GameVars.debrisSize);
            }
        }
Esempio n. 2
0
 public override void DeserializeObject(List <string> data)
 {
     base.DeserializeObject(data);
     try
     {
         PencilDevice = (TypeOfPencil)Enum.Parse(typeof(TypeOfPencil), data[currentItemList]);
         data.RemoveAt(currentItemList);
         PencilTexture = (TypeOfTexture)Enum.Parse(typeof(TypeOfTexture), data[currentItemList]);
         data.RemoveAt(currentItemList);
     }
     catch
     {
         throw new Exception();
     }
 }
Esempio n. 3
0
 public LipPencil(string ProductName, string Brand, PriceCategory PriceCategoryOfProduct, Color Color, string Aromatizer,
                  TypeOfPencil PencilDevice, TypeOfTexture PencilTexture) : base(ProductName, Brand, PriceCategoryOfProduct, Color, Aromatizer)
 {
     this.PencilDevice  = PencilDevice;
     this.PencilTexture = PencilTexture;
 }
Esempio n. 4
0
 /// <summary>
 /// </summary>
 /// <param name="type">Enum in TLMSType, defines the type of texture</param>
 /// <param name="path">Path to texture file</param>
 public void AddTexture(TypeOfTexture type, String path)
 {
     this.textureMap.Add(type, path);
 }