public void update(Player parent, GameTime currentTime, LevelState parentWorld) { offset = (float)Math.Sin(currentTime.TotalGameTime.TotalMilliseconds / 1000f) * 0.2f; Player.PlayerItems items = parent.CurrentItemTypes; if (exit == null) { foreach (Entity en in parentWorld.EntityList) { if (en is BetaEndLevelFag) { exit = (BetaEndLevelFag)en; } } } else { theta = (float)(Math.Atan2(parent.CenterPoint.Y - exit.CenterPoint.Y, parent.CenterPoint.X - exit.CenterPoint.X) - Math.PI) + offset; drawPos = parent.CenterPoint + new Vector2((float)(2 * GlobalGameConstants.TileSize.X * Math.Cos(theta)), (float)(2 * GlobalGameConstants.TileSize.Y * Math.Sin(theta))); } if (items.item1 == GlobalGameConstants.itemType.Compass && InputDevice2.IsPlayerButtonDown(parent.Index, InputDevice2.PlayerButton.UseItem1)) { parent.Velocity = Vector2.Zero; parent.LoadAnimation.Animation = parent.LoadAnimation.Skeleton.Data.FindAnimation("idle"); drawPointer = true; } else if (items.item2 == GlobalGameConstants.itemType.Compass && InputDevice2.IsPlayerButtonDown(parent.Index, InputDevice2.PlayerButton.UseItem2)) { parent.Velocity = Vector2.Zero; parent.LoadAnimation.Animation = parent.LoadAnimation.Skeleton.Data.FindAnimation("idle"); drawPointer = true; } else { drawPointer = false; parentWorld.RenderNodeMap = false; parent.State = Player.playerState.Moving; parent.Disable_Movement = false; } drawPos2 = parent.CenterPoint - img2.FrameDimensions / 2; }
public void update(Player parent, GameTime currentTime, LevelState parentWorld) { Player.PlayerItems items = parent.CurrentItemTypes; if (items.item1 == GlobalGameConstants.itemType.DungeonMap && InputDevice2.IsPlayerButtonDown(parent.Index, InputDevice2.PlayerButton.UseItem1)) { parent.Velocity = Vector2.Zero; parentWorld.RenderNodeMap = true; } else if (items.item2 == GlobalGameConstants.itemType.DungeonMap && InputDevice2.IsPlayerButtonDown(parent.Index, InputDevice2.PlayerButton.UseItem2)) { parent.Velocity = Vector2.Zero; parentWorld.RenderNodeMap = true; } else { parentWorld.RenderNodeMap = false; parent.State = Player.playerState.Moving; parent.Disable_Movement = false; } }