// Constructor for Moving Objects public HBackground(HEnum.BackgroundTyp pType, String pTextureName, String pPfad, Vector2 pXAxis, Vector2 pYAxis, int pAmount, float pSpeed) { this.Initialize("", Vector2.Zero, pTextureName, pPfad); _type = pType; _xRange = pXAxis; _yRange = pYAxis; _cloudAmount = pAmount; _cloudSpeed = pSpeed; }
// Initialize all the same protected void Initialize(String pType, Vector2 pPosition, String pTextureName, String pPfad) { _position = pPosition; _textureName = pTextureName; _pathName = pPfad; TextureManager.Instance.LoadParallaxSprite(pPfad, pTextureName); _width = TextureManager.Instance.GetParallax(pTextureName).Width; _height = TextureManager.Instance.GetParallax(pTextureName).Height; if (pType.Equals("HBackground")) _type = HEnum.BackgroundTyp.HBackground; else if (pType.Equals("HParallax")) _type = HEnum.BackgroundTyp.HParallax; else if (pType.Equals("HCloud")) _type = HEnum.BackgroundTyp.HCloud; }