Ejemplo n.º 1
0
        public override void Draw(RoomGraphics g)
        {
            base.Draw(g);

            g.DrawAnimationPlayer(arrowsAnimationPlayer, Zone.ImageVariantID, Position, Graphics.DepthLayer);
            g.DrawAnimationPlayer(turnstileAnimationPlayer, Zone.ImageVariantID, Position, Graphics.DepthLayer);
        }
Ejemplo n.º 2
0
        public override void Draw(RoomGraphics g)
        {
            base.Draw(g);

            if (flameAnimation != null) {
                g.DrawAnimation(flameAnimation, GameControl.RoomTicks,
                    Center - new Vector2F(0, 9), Graphics.DepthLayer);
            }
        }
Ejemplo n.º 3
0
        public override void Draw(RoomGraphics g)
        {
            //base.Draw(g);

            for (int y = 0; y < Height; y++) {
                for (int x = 0; x < Width; x++) {
                    g.DrawSprite(GameData.SPR_TILE_MOVING_PLATFORM, Zone.ImageVariantID,
                        Position + new Point2I(x, y) * GameSettings.TILE_SIZE, DepthLayer.TileLayer1);
                }
            }
        }
Ejemplo n.º 4
0
        // Draw the entity's graphics on the given depth layer.
        public void Draw(RoomGraphics g, DepthLayer layer)
        {
            if (!isVisible)
            {
                return;
            }

            // Draw the shadow.
            if (isShadowVisible && entity.ZPosition >= 1 &&
                entity.GameControl.RoomTicks % 2 == 0 && !entity.RoomControl.IsSideScrolling)
            {
                g.DrawSprite(GameData.SPR_SHADOW, Entity.Position + shadowDrawOffset, DepthLayer.Shadows);
            }

            if (isFlickering && !flickerIsVisible)
            {
                return;
            }

            // Change the variant if hurting.
            int newImageVariant = imageVariant;

            if (isHurting && entity.GameControl.RoomTicks % 8 >= 4)
            {
                newImageVariant = GameData.VARIANT_HURT;
            }

            // Draw the sprite/animation.
            Vector2F drawPosition = Entity.Position - new Vector2F(0, Entity.ZPosition);

            g.DrawAnimationPlayer(animationPlayer, newImageVariant,
                                  drawPosition + drawOffset, layer, entity.Position);

            // Draw the ripples effect.
            if (isRipplesEffectVisible && entity.Physics.IsEnabled && entity.Physics.IsInPuddle)
            {
                g.DrawAnimation(GameData.ANIM_EFFECT_RIPPLES,
                                entity.GameControl.RoomTicks, entity.Position +
                                ripplesDrawOffset, layer, entity.Position);
            }

            // Draw the grass effect.
            if (isGrassEffectVisible && entity.Physics.IsEnabled && entity.Physics.IsInGrass)
            {
                g.DrawAnimation(GameData.ANIM_EFFECT_GRASS,
                                grassAnimationTicks, entity.Position +
                                grassDrawOffset, layer, entity.Position);
            }
        }
Ejemplo n.º 5
0
        public override void Draw(RoomGraphics g)
        {
            // Draw the extension bar.
            if (extendLength > 0.0f) {
                Sprite spr;
                if (Directions.IsHorizontal(direction))
                    spr = GameData.SPR_TILE_PULL_HANDLE_BAR_HORIZONTAL;
                else
                    spr = GameData.SPR_TILE_PULL_HANDLE_BAR_VERTICAL;

                for (float length = 0.0f; length < extendLength; length += GameSettings.TILE_SIZE) {
                    Vector2F drawPos = Position - Offset + (Directions.ToVector(direction) * (length + 8.0f));
                    g.DrawSprite(spr, drawPos, DepthLayer.TileLayer1);
                }
            }

            base.Draw(g);
        }
Ejemplo n.º 6
0
        // Draw the entity's graphics on the given depth layer.
        public void Draw(RoomGraphics g, DepthLayer layer)
        {
            if (!isVisible)
                return;

            // Draw the shadow.
            if (isShadowVisible && entity.ZPosition >= 1 &&
                entity.GameControl.RoomTicks % 2 == 0 && !entity.RoomControl.IsSideScrolling)
            {
                g.DrawSprite(GameData.SPR_SHADOW, Entity.Position + shadowDrawOffset, DepthLayer.Shadows);
            }

            if (isFlickering && !flickerIsVisible)
                return;

            // Change the variant if hurting.
            int newImageVariant = imageVariant;
            if (isHurting && entity.GameControl.RoomTicks % 8 >= 4)
                newImageVariant = GameData.VARIANT_HURT;

            // Draw the sprite/animation.
            Vector2F drawPosition = Entity.Position - new Vector2F(0, Entity.ZPosition);
            g.DrawAnimationPlayer(animationPlayer, newImageVariant,
                drawPosition + drawOffset, layer, entity.Position);

            // Draw the ripples effect.
            if (isRipplesEffectVisible && entity.Physics.IsEnabled && entity.Physics.IsInPuddle) {
                g.DrawAnimation(GameData.ANIM_EFFECT_RIPPLES,
                    entity.GameControl.RoomTicks, entity.Position +
                    ripplesDrawOffset, layer, entity.Position);
            }

            // Draw the grass effect.
            if (isGrassEffectVisible && entity.Physics.IsEnabled &&entity.Physics.IsInGrass) {
                g.DrawAnimation(GameData.ANIM_EFFECT_GRASS,
                    grassAnimationTicks, entity.Position +
                    grassDrawOffset, layer, entity.Position);
            }
        }
Ejemplo n.º 7
0
 // Draw the entity's graphics,
 public void Draw(RoomGraphics g)
 {
     Draw(g, CurrentDepthLayer);
 }
Ejemplo n.º 8
0
        // Draw all tiles in the grid.
        public void DrawTiles(RoomGraphics g)
        {
            for (int i = 0; i < layerCount; i++) {
                for (int y = 0; y < GridHeight; y++) {
                    for (int x = 0; x < GridWidth; x++) {
                        Tile t = tiles[x, y, i];

                        if (t != null && IsTileAtGridLocation(t, x, y)) {
                            t.Draw(g);

                            /*
                            // DEBUG: draw grid cell occupance.
                            Rectangle2F tileBounds = (Rectangle2F) t.TileGridArea;
                            tileBounds.Point *= tileGridCellSize;
                            tileBounds.Size *= tileGridCellSize;
                            Color c = Color.Yellow;
                            if (i == 1)
                                c = Color.Blue;
                            else if (i == 2)
                                c = Color.Red;
                            g.FillRectangle(tileBounds, c);

                            tileBounds = new Rectangle2F(t.Position, t.Size * GameSettings.TILE_SIZE);
                            c = Color.Olive;
                            if (i == 1)
                                c = Color.Cyan;
                            else if (i == 2)
                                c = Color.Maroon;

                            g.DrawLine(new Line2F(tileBounds.TopLeft, tileBounds.BottomRight - new Point2I(1, 1)), 1, c);
                            g.DrawLine(new Line2F(tileBounds.TopRight - new Point2I(1, 0), tileBounds.BottomLeft - new Point2I(0, 1)), 1, c);
                            g.DrawRectangle(tileBounds, 1, Color.Black);
                            */
                        }
                    }
                }
            }
        }
Ejemplo n.º 9
0
 // Called every step to draw the entity.
 public virtual void Draw(RoomGraphics g)
 {
     graphics.Draw(g);
 }
        public void Draw(RoomGraphics g)
        {
            if (!isVisible)
                return;

            // Determine the depth layer based on the tile grid layer.
            if (tile.Layer == 0)
                depthLayer = DepthLayer.TileLayer1;
            else if (tile.Layer == 1)
                depthLayer = DepthLayer.TileLayer2;
            else if (tile.Layer == 2)
                depthLayer = DepthLayer.TileLayer3;

            // Determine draw position.
            Vector2F drawPosition = (useAbsoluteDrawPosition ?
                absoluteDrawPosition : tile.Position);
            drawPosition += (raisedDrawOffset + drawOffset);

            // Draw the tile's as-object sprite.
            if (tile.IsMoving && !tile.SpriteAsObject.IsNull) {
                g.DrawSpriteAnimation(tile.SpriteAsObject, imageVariant,
                    tile.RoomControl.GameControl.RoomTicks,
                    drawPosition, depthLayer, tile.Position);
            }
            // Draw the animation player.
            else {
                float playbackTime;
                if (syncPlaybackWithRoomTicks)
                    playbackTime = tile.RoomControl.GameControl.RoomTicks;
                else
                    playbackTime = animationPlayer.PlaybackTime;

                g.DrawAnimationPlayer(animationPlayer, imageVariant,
                    playbackTime, drawPosition, depthLayer, tile.Position);
            }
        }
Ejemplo n.º 11
0
 // Called every step to draw the entity.
 public virtual void Draw(RoomGraphics g)
 {
     graphics.Draw(g);
 }
Ejemplo n.º 12
0
        public override void Draw(RoomGraphics g)
        {
            base.Draw(g);

            g.DrawSprite(GameData.SPR_TILE_STATUE_EYE, Position + eyeOffset, DepthLayer.TileLayer1);
        }
Ejemplo n.º 13
0
 // Draw the entity's graphics,
 public void Draw(RoomGraphics g)
 {
     Draw(g, CurrentDepthLayer);
 }