Пример #1
0
    void ListarRanking()
    {
        int        position = 1;
        Rank       RankComponents;
        GameObject NewRank;

        foreach (Ranking rank in rankings)
        {
            NewRank = Instantiate(RankPrefab, RankingGO.transform);

            RankComponents = NewRank.GetComponent <Rank>();
            RankComponents.PosicionGO.GetComponent <Text>().text = "#" + position.ToString();
            RankComponents.NombreGO.GetComponent <Text>().text   = rank.Name;
            RankComponents.PuntosGO.GetComponent <Text>().text   = rank.Score.ToString();
            position++;
        }
    }
Пример #2
0
 public override void FillInformation(ISystem sys, out string info, out string detailed)
 {
     info     = BaseUtils.FieldBuilder.Build("", Name, "Old:".T(EDTx.JournalEntry_Old), OldRank.ToString().SplitCapsWord(), "New:".T(EDTx.JournalEntry_New), NewRank.ToString().SplitCapsWord());
     detailed = "";
 }
Пример #3
0
 public Card(NewSuit suit, NewRank rank)
 {
     this.Suit = suit;
     this.Rank = rank;
 }
Пример #4
0
        public override void Update()
        {
            base.Update();

            if (SelectedLevel == -1)
            {
                // Delay after klick on level to entering it
                delay--;
                if (delay == 0)
                {
                    SelectedLevel     = levelToBeSelected;
                    levelToBeSelected = -1;
                    Levels[SelectedLevel].Initialize(ThePlayer);
                    numberOfJumps++;
                    bossLerpPosition += new Vector2(100, 0);
                }

                // Boss
                bossPosition = new Vector2(MathHelper.Lerp(bossPosition.X, bossLerpPosition.X, 0.01f), bossPosition.Y);
                bossAnimationTimer++;
                if (bossAnimationTimer > 5)
                {
                    bossAnimationTimer = 0;
                    if (bossAnimationFrame < 3)
                    {
                        bossAnimationFrame++;
                    }
                    else
                    {
                        bossAnimationFrame = 0;
                    }
                }

                // SpaceObjects
                foreach (GameObject spaceObject in SpaceObjects)
                {
                    spaceObject.Update();
                }

                for (int i = SpaceObjects.Count() - 1; i >= 0; i--)
                {
                    if (SpaceObjects[i].Dead)
                    {
                        SpaceObjects.RemoveAt(i);
                    }
                }

                if (!ThePlayer.Dead)
                {
                    NewItems.Update();
                    NewRank.Update();

                    // Boss
                    if (Globals.Distance(bossPosition, Levels[playerPosition].EnterLevel.Position) < 300 && delay < 0 && !Levels[Levels.Count() - 1].Complete)
                    {
                        levelToBeSelected = Levels.Count() - 1;
                        delay             = 65;
                    }

                    Inventory.Update();
                    if (Inventory.Press())
                    {
                        SceneManager.ChangeScene(SceneManager.inventoryScene);
                        NewItems.Flash = -1;
                    }

                    Menu.Update();
                    if (Menu.Press())
                    {
                        SceneManager.ChangeScene(SceneManager.menuScene);
                        SoundManager.ChangeMusic(SoundManager.menu);
                    }

                    Rank.Update();
                    if (Rank.Press())
                    {
                        SceneManager.ChangeScene(SceneManager.rankScene);
                        NewRank.Flash = -1;
                    }

                    MapInfo.Update();
                }
                else
                {
                    playerDeath--;
                    if (playerDeath == 30)
                    {
                        SoundManager.explosion.Play();
                    }
                    if (playerDeath == 0)
                    {
                        SceneManager.ChangeScene(SceneManager.gameOverScene);
                    }
                }

                for (int i = 0; i < Levels.Count() - 1; i++)
                {
                    Levels[i].UpdateMap();

                    if (!ThePlayer.Dead)
                    {
                        if (nearestLevels.Any(item => item == Levels[i]) && Levels[i].EnterLevel.Pressed() && delay < 0)
                        {
                            if (!Levels[i].Complete)
                            {
                                levelToBeSelected = i;
                                delay             = 65;
                            }
                            PlayerMove(i);
                        }
                    }
                }
            }
            else
            {
                Levels[SelectedLevel].Update();
            }
        }
Пример #5
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            base.Draw(spriteBatch);

            if (SelectedLevel == -1)
            {
                // Space objects
                foreach (GameObject spaceObject in SpaceObjects)
                {
                    spaceObject.Draw(spriteBatch);
                }

                if (NewItems.Flash > 0)
                {
                    NewItems.Flash++;
                    NewItems.Draw(spriteBatch);
                }

                if (NewRank.Flash > 0)
                {
                    NewRank.Flash++;
                    NewRank.Draw(spriteBatch);
                }


                Inventory.Draw(spriteBatch);
                Menu.Draw(spriteBatch);
                Rank.Draw(spriteBatch);

                MapInfo.Draw(spriteBatch);

                // Boss
                if (!Levels[Levels.Count() - 1].Complete)
                {
                    spriteBatch.Draw(TextureManager.boss, bossPosition, null, Color.White, 0f, new Vector2(TextureManager.boss.Width / 2, TextureManager.boss.Height / 2), 0.6f, SpriteEffects.None, 0.2f);
                    spriteBatch.Draw(TextureManager.bossEngineAnimation, bossPosition, new Rectangle(163 * bossAnimationFrame, 0, 163, 139), Color.White, 0f, new Vector2(TextureManager.boss.Width / 2, TextureManager.boss.Height / 2), 0.6f, SpriteEffects.None, 0.1f);
                    for (int i = 0; i < 1000; i++)
                    {
                        spriteBatch.Draw(TextureManager.pixel, new Rectangle((int)(bossPosition.X + Math.Cos(((float)i / 1000f) * Math.PI * 2) * 300), (int)(bossPosition.Y + Math.Sin(((float)i / 1000f) * Math.PI * 2) * 300), 3, 3), Color.Red);
                    }
                }

                // Draw lines to close stars
                foreach (Level level in nearestLevels)
                {
                    Vector2 linePosition = level.EnterLevel.Position - Levels[playerPosition].EnterLevel.Position;
                    float   distance     = Globals.Distance(Levels[playerPosition].EnterLevel.Position, level.EnterLevel.Position) / 4;
                    for (float i = 0; i < distance; i++)
                    {
                        spriteBatch.Draw(TextureManager.pixel, new Rectangle((int)(Levels[playerPosition].EnterLevel.Position.X + linePosition.X * (i / distance)), (int)(Levels[playerPosition].EnterLevel.Position.Y + linePosition.Y * (i / distance)), 1, 1), Color.White);
                    }
                }

                for (int i = 0; i < Levels.Count() - 1; i++)
                {
                    Levels[i].DrawMap(spriteBatch);
                }
            }
            else
            {
                Levels[SelectedLevel].Draw(spriteBatch);
            }
        }
Пример #6
0
 public override void FillInformation(out string info, out string detailed)
 {
     info     = BaseUtils.FieldBuilder.Build("", Name, "Old:".Txb(this), OldRank.ToString().SplitCapsWord(), "New:".Txb(this), NewRank.ToString().SplitCapsWord());
     detailed = "";
 }