public override void Draw(Graphics g, GameTime gameTime, Room.Layer layer) { if (layer == Room.Layer.Player) { g.Begin(); ropeGrid.Draw(g, new Point(190, -20 + offsetY), diverFreezed?1:0); g.End(); } if (layer == Room.Layer.Foreground) { g.Begin(); if (collisionWithDiver && diverFreezed && !surface) { g.DrawStringShadowed(font, "Press Space to surface", new Rectangle(0, 100, 400, 20), TextAlignment.Center, Color.White); } g.End(); } }
public override void Draw(Graphics g, GameTime gameTime, Room.Layer layer) { if (layer == Room.Layer.Player) { if (Tool1 != null) Tool1.Draw(g, this); if (Tool2 != null) Tool2.Draw(g, this); g.Begin(); Point pos = new Point(Position.X - 2, Position.Y); if (climbing) ClimbingGrid.Draw(g, new Point(pos.X, pos.Y - (ClimbingGrid.FrameSize.Y - Height)), climbingGridFrame / ClimbAnimationSpeed, spriteEffects); else if (isOnGround && Velocity.X != 0) WalkingGrid.Draw(g, new Point(Center.X - WalkingGrid.FrameSize.X / 2, pos.Y - (WalkingGrid.FrameSize.Y - Height)), walkingGridFrame / WalkAnimationSpeed, spriteEffects); else if (isOnGround) StandingGrid.Draw(g, new Point(Center.X - StandingGrid.FrameSize.X / 2, pos.Y - (StandingGrid.FrameSize.Y - Height)), standingGridFrame, spriteEffects); else JumpingGrid.Draw(g, new Point(Center.X - JumpingGrid.FrameSize.X / 2, pos.Y - (JumpingGrid.FrameSize.Y - Height) + 5), jumpingGridFrame, spriteEffects); g.End(); } if (layer == Room.Layer.Foreground) { g.Begin(); if (collisionWithDiver && !Enabled) { g.DrawStringShadowed(font, "Press Space to select " + Name, new Rectangle(0, 100, 400, 20), TextAlignment.Center, Color.White); } g.End(); } }