// Use this for initialization
 void Start()
 {
     navController = NavigationController.Instance;
     highScoreManager = new HighScoreManager ();
     highScores = highScoreManager.LoadAllScores ();
     PopulateHighScores ();
 }
Пример #2
0
    void FindScripts()
    {
        // Find Controller GameObject
        GameObject controller =  Camera.main.gameObject;

        // Attach scripts that are attached to controller object
        sc_CameraController = controller.GetComponent<CameraController>();
        sc_GameController   = controller.GetComponent<GameController>();
        sc_LevelManager     = controller.GetComponent<LevelManager>();
        sc_RowManager       = controller.GetComponent<RowManager>();

        // Find Scripts not attached to controller object
        sc_AudioManager     = GameObject.Find("audio_manager").GetComponent<AudioManager>();

        if (LevelName == "Intro") return;

        sc_FadeToScene      = GameObject.FindGameObjectWithTag("Fade").GetComponent<FadeToScene>();
        sc_HighScoreManager = GameObject.FindGameObjectWithTag("Scores").GetComponent<HighScoreManager>();

        if (CheckObjectExist("score_tracker"))
            sc_ScoreTracker     = GameObject.Find("score_tracker").GetComponent<ScoreTracker>();

        if (CheckObjectExist("glow_ball"))
            sc_BallController   = GameObject.Find("glow_ball").GetComponent<BallController>();

        if (CheckObjectExist("boundaries"))
            sc_BoundaryManager   = GameObject.Find("boundaries").GetComponent<BoundaryManager>();
    }
Пример #3
0
 public void Initialize()
 {
     game = GameManager.instance;
     gui = OnGuiManager.instance;
     scoreManager = HighScoreManager.instance;
     centerX = gui.GetCenterX();
     centerY = gui.GetCenterY();
 }
Пример #4
0
 public static HighScoreManager GetInstance()
 {
     if (inst == null)
     {
         inst = new HighScoreManager();
     }
     return inst;
 }
Пример #5
0
        public override void LoadContent(Microsoft.Xna.Framework.Content.ContentManager pContent)
        {
            m_pManager = new HighScoreManager();
            m_pManager.LoadContent(pContent);

            m_pFont = pContent.Load<SpriteFont>("GFX\\Fonts\\defaultFont");

            base.LoadContent(pContent);
        }
Пример #6
0
	void Awake ()
	{
		if (m_instance == null) {
			m_instance = this;                        
		} else if (m_instance != this)                
			Destroy (gameObject);        
		
		DontDestroyOnLoad (gameObject);
	}
Пример #7
0
        public override void LoadContent(Microsoft.Xna.Framework.Content.ContentManager pContent)
        {
            m_pFont = pContent.Load<SpriteFont>("GFX\\Fonts\\defaultFont");
            m_pHighscore = new HighScoreManager();
            m_pHighscore.LoadContent(pContent);

            /*
             * Vi ska väl se ifall det var något highscore kanske?
             */
            if (this.Parent.Settings.PlayerOneScore > this.Parent.Settings.PlayerTwoScore)
            {
                m_nPlayerOnePosition = (m_pHighscore.AddHighscore(this.Parent.Settings.PlayerOneName, this.Parent.Settings.PlayerOneWave, this.Parent.Settings.PlayerOneScore, this.Parent.Settings.PlayerOnePlayTime));
                m_nPlayerTwoPosition = (m_pHighscore.AddHighscore(this.Parent.Settings.PlayerTwoName, this.Parent.Settings.PlayerTwoWave, this.Parent.Settings.PlayerTwoScore, this.Parent.Settings.PlayerTwoPlayTime));
            }
            else
            {
                m_nPlayerTwoPosition = (m_pHighscore.AddHighscore(this.Parent.Settings.PlayerTwoName, this.Parent.Settings.PlayerTwoWave, this.Parent.Settings.PlayerTwoScore, this.Parent.Settings.PlayerTwoPlayTime));
                m_nPlayerOnePosition = (m_pHighscore.AddHighscore(this.Parent.Settings.PlayerOneName, this.Parent.Settings.PlayerOneWave, this.Parent.Settings.PlayerOneScore, this.Parent.Settings.PlayerOnePlayTime));
            }

            base.LoadContent(pContent);
        }
Пример #8
0
 void Start()
 {
     highScoreManager = GetComponent <HighScoreManager>();
 }
Пример #9
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                Exit();
            }

            if (mouse.IsMouseDown)
            {
                if (wreckingBall.HitArea.Contains(mouse.MouseState.X, mouse.MouseState.Y))
                {
                    drag = true;
                }
            }
            if (!mouse.IsMouseDown)
            {
                drag = false;
            }

            if (drag)
            {
                wreckingBall.OriginHeight = mouse.MouseState.Y;
                //wreckingBall.Angle = -(int)((Math.Atan2(mouse.MouseState.Y, wreckingBall.Position.X - mouse.MouseState.X) * (180 / Math.PI)) - 90);
            }

            KeyboardState kbs = Keyboard.GetState();

            if (kbs.IsKeyDown(Keys.S) && prevState.IsKeyUp(Keys.S))
            {
                wreckingBall.Angle = 90;
                wreckingBall.Timer.Start();
            }

            if (kbs.IsKeyDown(Keys.R) && prevState.IsKeyUp(Keys.R))
            {
                _turn++;
                if (_turn < 4)
                {
                    wreckingBall.Timer.Reset();
                    wreckingBall.Reset();
                }
                else
                {
                    _turn = 3;
                    if (_score > highScore.Score)
                    {
                        HighScoreManager hsm = new HighScoreManager(this);
                        hsm.SaveData(new SaveGameData()
                        {
                            Score = _score
                        });
                    }
                }
            }

            prevState = kbs;

            for (int i = brickManager.Bricks.Count - 1; i >= 0; i--)
            {
                // Raakt de wrecking ball een blokje dan moet het blokje verwijderd worden.
                if (wreckingBall.HitArea.Intersects(brickManager.Bricks[i].Bounds))
                {
                    // Als het blokje Destructable is moet het blokje opgeruimd worden
                    if (brickManager.Bricks[i].Collide(true))
                    {
                        _score += brickManager.Bricks[i].Points;

                        ExplodingScore explodeScore = new ExplodingScore(
                            this,
                            brickManager.Bricks[i].Position,
                            brickManager.Bricks[i].Points,
                            brickManager.Bricks[i].Color, 1);

                        brickManager.Bricks[i].Dispose();
                        brickManager.Bricks[i] = null;
                        brickManager.Bricks.Remove(brickManager.Bricks[i]);
                    }
                    // TODO anders moet de wrecking ball vanaf hier terugkaatsen.
                    else
                    {
                    }
                }
                else
                {
                    brickManager.Bricks[i].Collide(false);
                }
            }

            base.Update(gameTime);
        }
Пример #10
0
 void Awake()
 {
     //This is the start of the Game. Period.
     Application.targetFrameRate = 60;
     DontDestroyOnLoad(gameObject);
     Application.LoadLevel("SplashScreen");
     BRAIN = gameObject.GetComponent<MasterController>();
     pHelper = new PreferencesManager();
     sbHelper = new SkyBoxManager(_skyBoxes);
     pcHelper = new PCInterface(gameObject);
     mHelper = new Mathius(_mathius);
     tHelper = new TileManager(pHelper);
     sHelper = new ScoreManager(mHelper,pHelper);
     hHelper = new HighScoreManager();
     aHelper = new Alien(_alien);
     iHelper = new HighScoreInitials(3);
     UI_MAIN_MENU = new Vector3(0.0f,1.0f,-13.75854f);
     UI_CAMERA_ALT = new Vector3(0.0f,1.0f,-10.0f);
     pcHelper.set_using_PCI(pHelper.get_usePerceptual());
 }
Пример #11
0
 void Start()
 {
     bossSpawned = false;
     score       = FindObjectOfType <HighScoreManager> ();
 }
Пример #12
0
 private void Awake()
 {
     buttonAnim = playButton.GetComponent <Animator>();
     hsmanager  = GetComponent <HighScoreManager>();
 }
Пример #13
0
 private void ResetScore()
 {
     HighScoreManager.WriteAttribute("name", "XXX");
     HighScoreManager.WriteAttribute("time", "00,0");
 }
Пример #14
0
 public void EnableGameOverCanvas()
 {
     StartCoroutine(Fade(_gameOverCanvasGroup, FadeSpeed));
     HideAllCanvases();
     finalTime.text = TimePrefix + ScoreAndTimeManager.finalTime.ToString(@"m\:ss\:ff");
     if (HighScoreManager.IsCurrentScoreHigherThanHighScore())
     {
         highScore.text         = HighScorePrefix + RichTextHighLightStringStart + HighScoreManager.ReturnHighScore() + RichTextHighLightStringEnd;
         finalScore.text        = ScorePrefix + RichTextHighLightStringStart + ScoreAndTimeManager.score + RichTextHighLightStringEnd;
         gameOverCanvas.enabled = true;
         return;
     }
     highScore.text         = HighScorePrefix + HighScoreManager.ReturnHighScore();
     finalScore.text        = ScorePrefix + ScoreAndTimeManager.score;
     gameOverCanvas.enabled = true;
 }
Пример #15
0
    // Use this for initialization
    void Start()
    {
        Text text = GetComponent <Text>();

        text.text = "" + HighScoreManager.getName();
    }
Пример #16
0
    void GetHighScoreShow()
    {
        HighScoreManager highScoreManager = new HighScoreManager();

        highScoreManager.LoadHighScore();
    }
Пример #17
0
 void Awake()
 {
     HighScoreManager.instance = this;
 }
Пример #18
0
 private void Awake()
 {
     instance = this;
     DontDestroyOnLoad(this);
 }
    public int maxNameCharacter = 3;                                //!< Maximum character amount for score name.

    // Use this for initialization
    void Start()
    {
        /// Loads the score data.
        HighScoreManager.LoadData();
        SetTableValues(HighScoreManager.GetHighScores());
    }
Пример #20
0
 // Start is called before the first frame update
 void Start()
 {
     _highScoreManager = GameObject.Find("Canvas").GetComponent <HighScoreManager>();
     _highScoreManager.WriteScores(_nameText, _scoreText);
 }
Пример #21
0
 void Start()
 {
     ScoreText        = GetComponent <Text>();
     highscoremanager = GameObject.FindObjectOfType <HighScoreManager>();
 }
Пример #22
0
 void Awake()
 {
     highScores = HighScoreXML.Load <HighScoreXML>();
     InvokeRepeating("UpdateScores", 0f, 300f);
     s_instance = this;
 }
Пример #23
0
    void Start()
    {
        // Attach Scripts to holders
        sc_ScriptHelper     = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<ScriptHelper>();
        sc_GameController   = sc_ScriptHelper.sc_GameController;
        sc_HighScoreManager = sc_ScriptHelper.sc_HighScoreManager;

        // Initialize score text
        score_text = gameObject.GetComponent<TextMesh>();
        score_text.text = "0";

        // If user hit retry or quit, hurry score count
        Hurry_GameOver_ScoreCount = false;
    }
Пример #24
0
        private void SaveRecordReplay()
        {
            if (_highScorePlayer == -1)
            {
                return;
            }
            List <long> scores;

            switch (_highScorePlayer)
            {
            case 4:
                scores = (from e in CombineScoreData(0) select(long) e).ToList();
                break;

            case 5:
                scores = Core.Players[0].ScoreHistory;
                break;

            default:
                scores = Core.Players[_highScorePlayer].ScoreHistory;
                break;
            }
            RecordReplayer.SaveRecord(scores, Core.Settings.Get <int>("LastSongPlayed"), HighScoreManager.TranslateGameType((GameType)Core.Cookies["CurrentGameType"]));
        }
Пример #25
0
    private static void OpenHighScoreManager()
    {
        HighScoreManager hsm = new HighScoreManager();

        hsm.SetHighScore();
    }
Пример #26
0
 void Start()
 {
     canvasManager      = GameObject.Find("GameCanvas").GetComponent <GameCanvasManager>();
     highScoreManager   = GameObject.Find("GameController").GetComponent <HighScoreManager>();
     sceneLoaderManager = GameObject.Find("SceneLoader").GetComponent <SceneLoaderManager>();
 }
Пример #27
0
 public void SaveHighScore()
 {
     // Save the high score
     HighScoreManager.SaveHighScore(this);
 }
Пример #28
0
    void Start()
    {
        _initial = InputInitial.ONE;
        MasterController.BRAIN.onEnterMenu();
        pc = MasterController.BRAIN.pci();
        pc.onGesturePerformed += HandlePconGesturePerformed;
        _score = MasterController.BRAIN.sm().get_score();
        _highScore = MasterController.BRAIN.hsm();
        _hsi = MasterController.BRAIN.hsi();
        if(_highScore.get_isHighScore()){//if it is a highscore!
            _hsi.onSuccessSwipe += Handle_hsionSuccessSwipe;
            _state = State.INPUT;
        }else{
            _state = State.DISPLAY;
            _highScore.saveScores();
        }
        _highScore.set_isHighScore(false);

        //Now to the actual gui making!
        guiInput = new GUIManager(thisMetalGUISkin);
        guiDisplay = new GUIManager(thisMetalGUISkin);

        //Input
        guiInput.OnClick += HandleGuiInputOnClick;

        guiInput.CreateGUIObject(HIGHSCORE,
                                 "HighScore",
                                 new Rect((Screen.width/5),(15*(Screen.height/100)),(3*(Screen.width/5)),(10*(Screen.height/100))),
                                 GUIType.Label,
                                 "box");
        guiInput.CreateGUIObject(SCORE,
                                 ("SCORE: " + _score),
                                 new Rect((Screen.width/5),(27*(Screen.height/100)),(3*(Screen.width/5)),(10*(Screen.height/100))),
                                 GUIType.Label,
                                 "box");
        guiInput.CreateGUIObject(INITIALS,
                                 (_hsi.initials()),
                                 new Rect((Screen.width/5),(45*(Screen.height/100)),(3*(Screen.width/5)),(10*(Screen.height/100))),
                                 GUIType.Label,
                                 "box");

        //left most

        guiInput.CreateGUIObject(UP1,
                                " /\\",
                                new Rect((Screen.width/100)*45, (Screen.height/100)*45,(Screen.width/100)*2, (Screen.height/100)*5),
                                GUIType.Button,
                             	"button",
                                false,
                                0.0f,
                                0.0f,
                                0.0f,
                                false);
        guiInput.CreateGUIObject(DOWN1,
                                 " \\/",
                                 new Rect((Screen.width/100)*45, (Screen.height/100)*55,(Screen.width/100)*2, (Screen.height/100)*5),
                                 GUIType.Button,
                                 "button",
                                 false,
                                 0.0f,
                                 0.0f,
                                 0.0f,
                                 false);
        //---end left most

        //center
        guiInput.CreateGUIObject(UP2,
                                 " /\\",
                                 new Rect((Screen.width/100)*50, (Screen.height/100)*45,(Screen.width/100)*2, (Screen.height/100)*5),
                                 GUIType.Button,
                                 "button",
                                 false,
                                 0.0f,
                                 0.0f,
                                 0.0f,
                                 false);
        guiInput.CreateGUIObject(DOWN2,
                                 " \\/",
                                 new Rect((Screen.width/100)*50, (Screen.height/100)*55,(Screen.width/100)*2, (Screen.height/100)*5),
                                 GUIType.Button,
                                 "button",
                                 false,
                                 0.0f,
                                 0.0f,
                                 0.0f,
                                 false);
        //---end center

        //far right
        guiInput.CreateGUIObject(UP3,//right up button
                                 " /\\",
                                 new Rect((Screen.width/100)*54, (Screen.height/100)*45,(Screen.width/100)*2, (Screen.height/100)*5),
                                 GUIType.Button,
                                 "button",
                                 false,
                                 0.0f,
                                 0.0f,
                                 0.0f,
                                 false);
        guiInput.CreateGUIObject(DOWN3, //right down button
                                 " \\/",
                                 new Rect((Screen.width/100)*54, (Screen.height/100)*55,(Screen.width/100)*2, (Screen.height/100)*5),
                                 GUIType.Button,
                                 "button",
                                 false,
                                 0.0f,
                                 0.0f,
                                 0.0f,
                                 false);

        //---end far right

        guiInput.CreateGUIObject(ENTER,
                                 "ENTER",
                                 new Rect((Screen.width/20) ,(90*(Screen.height/100)) ,(4*(Screen.width/10)) ,(15*(Screen.height/100))),
                                 GUIType.Button,
                                 "box");
        guiInput.CreateGUIObject(LEFT,
                                 "<",
                                 new Rect((Screen.width/100)*42, (Screen.height/100)*50,(Screen.width/100)*2, (Screen.height/100)*5),
                                 GUIType.Button,
                                 "button");
        guiInput.CreateGUIObject(RIGHT,
                                 ">",
                                 new Rect((Screen.width/100)*58, (Screen.height/100)*50,(Screen.width/100)*2, (Screen.height/100)*5),
                                 GUIType.Button,
                                 "button");

        //Display
        guiDisplay.OnClick += HandleGuiDisplayOnClick;

        guiDisplay.CreateGUIObject(MAINMENU,
                                   "Main Menu",
                                   new Rect(5*(Screen.width/10) ,(90*(Screen.height/100)) ,(4*(Screen.width/10)) ,(15*(Screen.height/100))),
                                   GUIType.Button,
                                   "box");
        guiDisplay.CreateGUIObject(REPLAY,
                                   "Replay",
                                   new Rect((Screen.width/20) ,(90*(Screen.height/100)) ,(4*(Screen.width/10)) ,(15*(Screen.height/100))),
                                   GUIType.Button,
                                   "box");
        guiDisplay.CreateGUIObject(GAMEOVER,
                                   "GameOver",
                                   new Rect((Screen.width/5)/2,(3*(Screen.height/100)),(4*(Screen.width/5)),(10*(Screen.height/100))),
                                   GUIType.Label,
                                   "label");
        guiDisplay.CreateGUIObject(FINAL_SCORE,
                                   ("SCORE: " + _score),
                                   new Rect((Screen.width/5),(47*(Screen.height/100)),(3*(Screen.width/5)),(18*(Screen.height/100))),
                                   GUIType.Label,
                                   "label");

        guiInput.connect(UP1,ENTER,UP2,"",DOWN1);
        guiInput.connect(UP2,UP1,UP3,"",DOWN2);
        guiInput.connect(UP3,UP2,ENTER,"",DOWN3);
        guiInput.connect(DOWN1,ENTER,DOWN2,UP1,"");
        guiInput.connect(DOWN2,DOWN1,DOWN3,UP2,"");
        guiInput.connect(DOWN3,DOWN2,ENTER,UP3,"");
        guiInput.connect(ENTER,UP3,UP1,UP1,UP1);

        guiInput.pointer = UP1;

        guiDisplay.connect(REPLAY,MAINMENU,MAINMENU,"","");
        guiDisplay.connect(MAINMENU,REPLAY,REPLAY,"","");
        guiDisplay.pointer = REPLAY;
    }
Пример #29
0
 void Awake()
 {
     Instance = this;
 }
Пример #30
0
    private void Awake()
    {
        var highscoreText = GetComponent <TextMeshProUGUI>();

        highscoreText.text = HighScoreManager.GetHighScore().ToString();
    }
Пример #31
0
 // Use this for initialization
 void Start()
 {
     highScoreManager = new HighScoreManager();
 }
Пример #32
0
 void Awake()
 {
     instance   = this;
     highscores = Load();
 }
 // Use this for initialization
 void Start()
 {
     g_instance    = this;
     m_leaderBoard = new Pair[m_maxScores];
     loadScores();
 }
Пример #34
0
        public static void Main()
        {
PlayGame:

            Console.Title         = "Snake Game";
            Console.CursorVisible = false;

            ConsolePrinter.DrawField(HighScoreManager.GetCurrentScore());
            ConsolePrinter.PrintSnake(snake);

            Point oldDirection = DirectionManager.GetNextMoveDirection(ConsoleKey.RightArrow);
            Point newDirection = DirectionManager.GetNextMoveDirection(ConsoleKey.RightArrow);

            Point food = PositionManager.SpawnFood();

            while (true)
            {
                if (Console.KeyAvailable)
                {
                    ConsoleKeyInfo currDirection = Console.ReadKey();

                    if (ConsoleKeyManager.IsArrowKey(currDirection))
                    {
                        newDirection = DirectionManager.GetNextMoveDirection(currDirection);
                    }

                    //Check if "Esc" key is pressed
                    if (currDirection.Key == ConsoleKey.Escape)
                    {
                        ConsolePrinter.PrintPauseMenu();
                        currDirection = Console.ReadKey();

                        while (!ConsoleKeyManager.PauseMenyAllowedKeys(currDirection.Key))
                        {
                            if (currDirection.Key == ConsoleKey.Escape)
                            {
                                goto Print;
                            }

                            currDirection = Console.ReadKey();
                        }
                    }

                    var isValidMove = PositionManager.CheckIfMoveIsValid(oldDirection, newDirection);

                    if (isValidMove)
                    {
                        newDirection = oldDirection.Coordinates();
                    }

                    oldDirection = newDirection.Coordinates();
                }

                ateFood = PositionManager.CheckIfSnakeAte(snake, food);

                try
                {
                    snake = SnakeManager.Update(snake, newDirection, ateFood);
                    food  = ateFood ? PositionManager.SpawnFood() : food;
                    HighScoreManager.IncreaseScore(ateFood);
                    goto Print;
                }
                catch (GameOverException goe)
                {
                    ConsolePrinter.PrintGameOverScreen(goe.Message);
                    ConsolePrinter.PrintPlayerScore(HighScoreManager.GetCurrentScore());
                    ConsolePrinter.PrintContinueScreen(Constants.ContinueMessage);

                    goto GameOver;
                }

Print:

                ConsolePrinter.DrawField(HighScoreManager.GetCurrentScore());
                ConsolePrinter.PrintFood(food);
                ConsolePrinter.PrintSnake(snake);
                SnakeSpeedManager.CurrentSpeed(ateFood);
            }

GameOver:

            ConsoleKeyInfo playerChoice = Console.ReadKey();

            if (ConsoleKeyManager.IsValidContinueGameKey(playerChoice))
            {
                goto PlayGame;
            }
            else
            {
                Environment.Exit(0);
            }
        }
Пример #35
0
 public void SaveHighscore(Text name)
 {
     HighScoreManager.NewScore(name.text, Phone.phone.contFreirasTotal);
     restart.interactable = true;
     menu.interactable    = true;
 }
Пример #36
0
    private List <string> GetScoreList()
    {
        HighScoreManager hsm = new HighScoreManager();

        return(hsm.GetHighScore());
    }
Пример #37
0
        private void CreateSongList()
        {
            _songList.Clear();
            SongListItem.ClearIndicatorSize = Core.Metrics["SongListItem.ClearIndicatorSize", 0];
            foreach (var song in Core.Songs.Songs)
            {
                var hse         = Core.HighScores.GetHighScoreEntry(song.GetHashCode(), HighScoreManager.TranslateGameType((GameType)Core.Cookies["CurrentGameType"]));
                var clearColour = (hse == null) || (hse.Grade == FAIL_GRADE) ? -1 : (int)hse.Difficulty;
                _songList.Add(new SongListItem
                {
                    Size         = Core.Metrics["SongListItem.Size", 0],
                    Song         = song,
                    TextMaxWidth = (int)Core.Metrics["SongListItem.MaxTextWidth", 0].X,
                    ClearColour  = clearColour
                });
            }

            _songSortDisplay.SongList     = _songList;
            _songSortDisplay.SongSortMode = Core.Settings.Get <SongSortMode>("LastSortMode");
        }
Пример #38
0
 // Use this for initialization
 void Start()
 {
     highScoreManager = new HighScoreManager ();
 }
 void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(gameObject);
         return;
     }
     else
     {
         instance = this;
     }
 }