Example #1
0
 public void backToMenu(long score, int stage)
 {
     gameModel = LoadSaveService.saveCurrentGame(1, score, stage, player.getBombs());
     generateHeartsLifes();
     updateCanvas();
     restartMenu();
     music.playSong("casaAsteroide");
 }
Example #2
0
    // private GameController game;
    //private Home
    // Use this for initialization
    void Start()
    {
        gameModel = LoadSaveService.Load();
        generateHeartsLifes();
        updateCanvas();
        restartMenu();
        music.playSong("casaAsteroide");

        FirebaseController firebase = new FirebaseController();

        firebase.sendMessageTo("ePm0ZIBWHM8:APA91bGH2NDzbX08wK7i9yXZyIBxHHUYqgi5MlxM3e3hAr1L0u_a1Z4AcebqwuYq72i3Lx_0Onha0F_LLZZOs8Wj-crsLcdX2pCVUapwaDQaTbs8Wc77wpmjvExBatA22FvOTKaAQVv7", "Javier");
    }
Example #3
0
        public static List <Piece> ListAllPieces(int gameID)
        {
            // Hämta spelare.
            List <Player> players = LoadSaveService.Load(gameID).Players;

            // Lista som innehåller alla pjäser i spelet.
            var allPlayersPieces = new List <Piece>();

            // Lägg till alla pjäser i listan.
            foreach (var player in players)
            {
                foreach (var piece in player.Pieces)
                {
                    allPlayersPieces.Add(piece);
                }
            }

            return(allPlayersPieces);
        }
Example #4
0
 public void addBoms(int boms)
 {
     gameModel = LoadSaveService.addBoms(boms);
 }
Example #5
0
 public void setLifesTo(int lifes)
 {
     gameModel = LoadSaveService.addLifes(lifes);
     generateHeartsLifes();
     updateCanvas();
 }
Example #6
0
 /// <summary>
 /// Returns a list of pieces on a specific game and player.
 /// </summary>
 /// <param name="gameID">Game ID of a game on file.</param>
 /// <param name="playerNumber">Number of the player in the game.</param>
 /// <returns></returns>
 public List <Piece> ListPlayerPieces(int gameID, int playerNumber) =>
 LoadSaveService.Load(gameID)                  // Ladda spel.
 .Players.Where(p => p.Number == playerNumber) // Hämta spelaren från spelet.
 .First().Pieces;                              // Hämta pjäserna från spelaren.