Exemple #1
0
        public new AnimationRotated Clone()
        {
            AnimationRotated cloned = new AnimationRotated(this.texture, this.textureFrame.Width, this.textureFrame.Height, this.textureBounds, this.drawOffset, this.states, this.frames);

            cloned.drawLayer  = this.drawLayer;
            cloned.drawOffset = new Vector2f(this.drawOffset.X, this.drawOffset.Y);
            cloned.color      = this.color;
            return(cloned);
        }
Exemple #2
0
        public Player(TextureAtlases textureAtlases, string name)
        {
            this.name           = name;
            this.textureAtlases = textureAtlases;
            collisionBox        = new BoundingBox(16, 16);
            drawingBox          = new BoundingBox(-64, -64, 64, 64);
            velocity            = new Vector2(0, 0);
            IntRect bounds;
            Texture playerTexture = textureAtlases.GetTexture("orcrunning", out bounds);

            walking           = new AnimationRotated(playerTexture, 128, 128, bounds, new Vector2f(0, -32), 8, 8);
            walking.drawLayer = Drawable.DrawLayer.EntitySorted;
            walking.behavior  = AnimationRotated.AnimationBehavior.Forward;
            drawArray         = new Drawable[] { walking };
            collisionMask     = CollisionLayer.EntityPhysical | CollisionLayer.TerrainSolid;
            mapColor          = Color.Magenta;
        }