Exemple #1
0
        public override IObject2D CreateObject2D(LandWorld2D landWorld2D, IObject obj)
        {
            WaterLandObject waterLandObject = obj as WaterLandObject;

            if (waterLandObject != null)
            {
                return(new WaterObject2D(this, waterLandObject));
            }
            return(null);
        }
Exemple #2
0
        public WaterObject2D(IObject2DFactory factory, WaterLandObject landObject)
        {
            Texture texture = factory.GetTextureByIndex(0);

            this.textureRect  = this.GetTransitionTextureCoord(landObject.LandTransition);
            this.ObjectSprite = new Sprite(texture, this.textureRect);

            this.ObjectSprite.Position = this.ObjectSprite.Position;
            this.ObjectSprite.Color    = new Color(255, 255, 255, 127);
            this.ObjectSprite.Scale    = new Vector2f(0.5f, 0.5f);

            this.Position = new Vector2f(landObject.Position.X, landObject.Position.Y);
        }