public void UpdateMoonPositions(PagingSystem paging, Dictionary <short, PlanetData> planets) { for (short i = paging.MinVal; i < paging.MaxVal; i++) { PlanetData planet = planets[i]; foreach (MoonData moon in planet.moons) { moon.posX += moon.speed; if (moon.speed > 0 && moon.posX > 70) { moon.posX = 70; moon.speed = (float)-Math.Abs(moon.speed); moon.front = false; } else if (moon.posX < -70) { moon.posX = -70; moon.speed = (float)Math.Abs(moon.speed); moon.front = true; } if (moon.speed > 0) { moon.posY = moon.lat - (float)Math.Sqrt(70 - Math.Abs(moon.posX)) * -3.2f; } else if (moon.speed < 0) { moon.posY = moon.lat + (float)Math.Sqrt(70 - Math.Abs(moon.posX)) * -3.2f; } } } }
public MyLevelsScene() : base() { // UI State UIHandler.SetUIOptions(true, true); UIHandler.SetMenu(null, true); // Prepare Components this.playerInput = Systems.localServer.MyPlayer.input; // Prepare Level Paging System (full paging system) this.paging = new PagingSystem(7, 4, (short)MyLevelsScene.slotsAllowed); // Load Level Data for (short i = this.paging.MinVal; i < this.paging.MaxVal; i++) { this.ApplyLevelDataByNumber(i); } }
public PlanetSelectScene() : base() { // UI State UIHandler.SetUIOptions(true, true); UIHandler.SetMenu(null, true); // Prepare Components this.playerInput = Systems.localServer.MyPlayer.input; this.atlas = Systems.mapper.atlas[(byte)AtlasGroup.World]; // Screen UI this.logo = Systems.game.Content.Load <Texture2D>("Images/creo-logo"); this.versionBlurbHalf = (short)(Systems.fonts.console.font.MeasureString(PlanetSelectScene.versionBlurb).X * 0.5f); this.openMenuHalf = (short)(Systems.fonts.baseText.font.MeasureString(PlanetSelectScene.openMenuBlurb).X * 0.5f); // Prepare Space this.LoadPlanets("Planets", this.planets); this.GenerateStars(); // Prepare Planet Paging System this.paging = new PagingSystem(5, 2, (short)this.planets.Count); }
/// <summary> /// 获取分页文本 /// </summary> /// <param name="style">分页样式</param> /// <returns></returns> protected string GetPagingHtml() { return(PagingSystem.SevenStyle8(PageIndex, PageCount, PageAddress)); }