Example #1
0
 void Start()
 {
     //scr = (ScoreUpdater)gc.GetComponent (typeof(ScoreUpdater));
     gc  = GameObject.Find("Game Controller");
     scr = gc.GetComponent <ScoreUpdater>();
     InvokeRepeating("pitch", 2f, 5f);
 }
Example #2
0
 void Start()
 {
     scoringScript = (ScoreUpdater)gc.GetComponent(typeof(ScoreUpdater));
     spawn1        = GameObject.Find("FireworkSpawn1");
     spawn2        = GameObject.Find("FireworkSpawn2");
     spawn3        = GameObject.Find("FireworkSpawn3");
 }
Example #3
0
    public void CheckEndOfLevel()
    {
        if (Coin.numberOfActiveCoins <= 0)
        {
            //Reset the "level"
            foreach (var item in Coin.allDeactivatedCoins)
            {
                item.gameObject.SetActive(true);
                Coin.numberOfActiveCoins++;
            }
            Coin.allDeactivatedCoins.Clear();
            if (GameManager.INSTANCE.IsTheHost())
            {
                foreach (var item in ScoreUpdater.INSTANCE.allScores)
                {
                    ScoreUpdater.CheckHigestOrLowestScore(item);
                }
                //Set the player with lowest score to be pacman
                // If there is a tie, take the first that comes up in the list
                Character pac = PlayerHandler.INSTANCE.currentHolderOfPac.controlledCharacter;
                pac.SwitchControllers(ScoreUpdater.lowestScore.controller.controlledCharacter);

                //Reset there positions
                PlayerHandler.INSTANCE.ResetCharactersPosition();
                PlayerHandler.INSTANCE.SyncInputControllers();
            }
        }
    }
Example #4
0
 void Start()
 {
     SetDeathParticleParent();
     scoreUpdater      = FindObjectOfType <ScoreUpdater>();
     enemyCountUpdater = FindObjectOfType <EnemyCountUpdater>();
     audioSource       = GetComponent <AudioSource>();
 }
Example #5
0
        public void UpdateScore_Game_Null_Throws()
        {
            var    scoreBoard   = Mock.Of <ScoreBoard>();
            var    scoreUpdater = new ScoreUpdater(scoreBoard);
            Action action       = () => scoreUpdater.UpdateScore(null, It.IsAny <int>(), It.IsAny <int>());

            action.Should().Throw <ArgumentNullException>();
        }
Example #6
0
    //	void Start () {
    //				
    //				moveSpeed = factory.createEnemyA ().getMoveSpeed ();
    //				HP = factory.createEnemyA ().getHP ();
    //				Debug.Log (moveSpeed+"-"+HP);
    //	}



    void Awake()
	{
		// Setting up the references.
		ren = transform.Find("body").GetComponent<SpriteRenderer>();
		frontCheck = transform.Find("frontCheck").transform;
		score = GameObject.Find("Score").GetComponent<Score>();
        scoreUpdater = new ScoreUpdater();
	}
Example #7
0
        public void ScoreUpdaterWorks()
        {
            ScoreUpdater updater = new ScoreUpdater();
            Student      student = updater.UpdateScore(
                new Student(), 5f);

            Assert.AreEqual(student.Score, 5f);
        }
Example #8
0
 protected override void Start()
 {
     base.Start();
     score              = GameObject.FindGameObjectWithTag("Score").GetComponent <ScoreUpdater>();
     cargo              = GameObject.FindGameObjectWithTag("Cargo").GetComponent <CargoUpdater>();
     rotation           = new Vector3(0, 0, 360 - RotationAngle);
     transform.rotation = Quaternion.Euler(rotation);
 }
Example #9
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        ScoreUpdater updater = (ScoreUpdater)target;

        if (GUILayout.Button("Add: Enemy killed"))
        {
            updater.AddScore((int)ScoreUpdater.points.Enemy);
        }
    }
Example #10
0
 void Start()
 {
     if (!destroyed)
     {
         scoreUpdater = GameObject.FindGameObjectWithTag("Score").GetComponent <ScoreUpdater>();
         scoreUpdater.RegisterPickup();
         timeUpdater = GameObject.FindGameObjectWithTag("Time").GetComponent <TimeUpdater>();
         registered  = true;
     }
 }
Example #11
0
    void Awake()
	{	
		IEnemyB hardB = new EnemyFactoryHard().createEnemyB();
		moveSpeed = hardB.getMoveSpeed();		// The speed the enemy moves at.
		HP = hardB.getHP();	
		// Setting up the references.
		ren = transform.Find("body").GetComponent<SpriteRenderer>();
		frontCheck = transform.Find("frontCheck").transform;
		score = GameObject.Find("Score").GetComponent<Score>();
        scoreUpdater = new ScoreUpdater();
	}
Example #12
0
 // Start is called before the first frame update
 private void Awake()
 {
     if (INSTANCE)
     {
         Destroy(this);
     }
     else
     {
         INSTANCE = this;
     }
 }
Example #13
0
 public void AddToValue(int amount)
 {
     value += amount;
     playerView.SetScoreText(value);
     ScoreUpdater.CheckHigestOrLowestScore(this);
     ////Update Value in key for player
     if (GameManager.INSTANCE.IsTheHost() && DiscordLobbyService.INSTANCE.Online())
     {
         ScoreData data = new ScoreData(value, id);
         DiscordNetworkLayerService.INSTANCE.SendMessegeToAllOthers(NetworkChannel.SCORE_SYNC, data.ToBytes());
     }
 }
Example #14
0
	void Awake()
	{
		IEnemyFactory factory = new EnemyFactoryEasy ();	
		IEnemyA easyA = factory.createEnemyA();
		moveSpeed = easyA.getMoveSpeed ();
		HP = easyA.getHP();	
		// Setting up the references.
		ren = transform.Find("body").GetComponent<SpriteRenderer>();
		frontCheck = transform.Find("frontCheck").transform;
		score = GameObject.Find("Score").GetComponent<Score>();
        scoreUpdater = new ScoreUpdater();
	}
Example #15
0
 void Start()
 {
     levelController = GameObject.Find("Level Controller").GetComponent <LevelController>();
     if (levelController.GetGameMode() != LevelController.GameMode.TimeTrial)
     {
         Destroy(minutesText);
         Destroy(secondsText);
         Destroy(colonText);
         Destroy(gameObject);
     }
     startTime    = Time.timeSinceLevelLoad;
     scoreUpdater = GameObject.FindGameObjectWithTag("Score").GetComponent <ScoreUpdater>();
     timeAnimator = GetComponent <Animator>();
 }
Example #16
0
    [SerializeField] Text sumScoreText;            //合計スコア

    public IEnumerator ShowResult(ScoreUpdater score)
    {
        tempSumScore = 0;            //最初の値は確かに0にする。

        scoreCanvas.SetActive(true); //キャンバスを見れるようにする。
        //すべて文字なしにする。
        basicScoreText.text       = "";
        timeScoreText.text        = "";
        remainSkillScoreText.text = "";
        nagiharaiScoreText.text   = "";
        nomissScoreText.text      = "";
        sumScoreText.text         = "";

        basicScoreExpText.text       = "";
        timeScoreExpText.text        = "";
        remainSkillExpScoreText.text = "";
        nagiharaiScoreExpText.text   = "";
        nomissScoreExpText.text      = "";

        yield return(DouwnScoreScreen());//スクリーンが降りてくる

        BasicScore();
        yield return(new WaitForSeconds(0.5f));

        timeScore();
        yield return(new WaitForSeconds(0.5f));

        RemainSkillScore();
        yield return(new WaitForSeconds(0.5f));

        Chack50MaxHit();
        yield return(new WaitForSeconds(0.5f));

        NoMissChack();

        yield return(new WaitForSeconds(1f));

        doomAudio.Play();
        sumScoreText.color = Color.yellow;//色を変える
        yield return(new WaitForSeconds(0.5f));

        score(tempSumScore);//マスターの方に適用させる

        buttons.SetActive(true);

        yield return(null);
    }
Example #17
0
        public void UpdateScore_ScoreAwayHasValueAndScoreHomeNull_IncrementsTotalScore(int awayScore, int expected)
        {
            var scoreBoard = ScoreBoardInitializer();

            var game = new Game()
            {
                Id       = 2,
                HomeTeam = new HomeTeam()
                {
                    Name = "Madrid"
                },
                AwayTeam = new AwayTeam()
                {
                    Name = "Bilbao"
                },
            };

            var ScoreUpdater = new ScoreUpdater(scoreBoard);

            ScoreUpdater.UpdateScore(game, null, awayScore);

            Assert.Equal(expected, scoreBoard.Games[1].Score.TotalScore);
        }
Example #18
0
        public void UpdateScore_ScoreHomeAndScoreAway_IncrementsScoreHome(int homeScore, int awayScore, int expected)
        {
            var scoreBoard = ScoreBoardInitializer();

            var game = new Game()
            {
                Id       = 1,
                HomeTeam = new HomeTeam()
                {
                    Name = "Barcelona"
                },
                AwayTeam = new AwayTeam()
                {
                    Name = "Sevilla"
                },
            };

            var ScoreUpdater = new ScoreUpdater(scoreBoard);

            ScoreUpdater.UpdateScore(game, homeScore, awayScore);

            Assert.Equal(expected, scoreBoard.Games[0].Score.HomeScore);
        }
Example #19
0
        private IEnumerator ScoreUpdateCoroutine()
        {
            ArenaInterfaceManager arenaManager = null;
            ScoreUpdater          scoreUpdater = null;

            while (true)
            {
                if (currentSimulation != null && currentSimulation.TryGetObservedPlayerScoreInfo(out var scoreInfo))
                {
                    if (scoreLable != null)
                    {
                        if (scoreUpdater == null)
                        {
                            scoreUpdater = scoreLable.GetComponent <ScoreUpdater>();
                        }
                        if (scoreUpdater != null)
                        {
                            scoreUpdater.Value = (int)scoreInfo.score;
                        }
                    }

                    if (arenaGameInterfase != null)
                    {
                        if (arenaManager == null)
                        {
                            arenaManager = arenaGameInterfase.GetComponent <ArenaInterfaceManager>();
                        }
                        if (arenaManager != null)
                        {
                            arenaManager.CurMultiplier = (scoreInfo.multiplier.HasValue) ? scoreInfo.multiplier.Value : 1;
                        }
                    }
                }

                yield return(null);
            }
        }
Example #20
0
 // Use this for initialization
 void Start()
 {
     //rb = GetComponent<Rigidbody>();
     //rb.velocity = new Vector3(1 * speed, -6, -1 * speed);
     //rb.velocity = rb.transform.forward * speed;
     //Debug.Log("pitched");
     //hit_bat = false;
     //src = GetComponent<AudioSource>();
     rb     = GetComponent <Rigidbody>();
     force1 = GetComponent <ConstantForce>();
     hand   = GameObject.Find("Game Controller").GetComponent <ScoreUpdater>();
     //rb.velocity = new Vector3(1 * speed, -6, -1 * speed);
     pitch = Random.Range(0, 4);
     if (pitch == 0)
     {
         rb.velocity = rb.transform.forward * speed * 1f;
     }
     else if (pitch == 1)
     {
         rb.velocity = rb.transform.forward * speed * 1.5f;
     }
     else if (pitch == 2)
     {
         transform.Rotate(0, 12, 0);
         rb.velocity  = rb.transform.forward * speed * 1.2F;
         force1.force = new Vector3(3, 0, 3);
     }
     else if (pitch == 3)
     {
         transform.Rotate(0, -11, 0);
         rb.velocity  = rb.transform.forward * speed * 1.2F;
         force1.force = new Vector3(-3, 0, -3);
     }
     Debug.Log("pitched");
     hit_bat = false;
     src     = GetComponent <AudioSource>();
 }
Example #21
0
 public void UpdateScore(ScoreUpdater a_scoreUpdaterobj)
 {
     a_scoreUpdaterobj.SetScore(m_fruitHitScore);
 }
Example #22
0
    public void StopGame()
    {
        // Do animation after waiting endingDuration
        if (!ended && frames >= endingDuration && !goldiEvent)
        {
            if (ani.GetCurrentAnimatorStateInfo(0).IsName("CamDown"))
            {
                ani.Play("SwipeCamUp");
            }
            ended = true;
        }

        // Goldi animation

        if (!ended && frames >= endingDuration && goldiEvent && !goldiAniStarted && !goldiAniFinished)
        {
            GameObject.Find("ObstacleSpawner").GetComponent <ObstacleSpawner>().StartGoldiAnimation();
            goldiAniStarted = true;
        }

        if (!ended && frames >= endingDuration && goldiEvent && goldiAniStarted && !goldiAniFinished)
        {
            if (GameObject.Find("ObstacleSpawner").GetComponent <ObstacleSpawner>().StepGoldiAnimation())
            {
                GameObject player = GameObject.Find("Player");
                player.GetComponent <Player_Move>().playerInitialized = false;
                player.GetComponent <Player_Move>().gameStoped        = false;
                Player_Move.firstGoldiGame = true;
                player.GetComponent <Player_Move>().jumpable = true;
                Player_Move.goldiEvent = false;
                endingGame             = false;
                goldiAniStarted        = false;
                goldiAniFinished       = true;
                goldiEvent             = false;
                frames = 0;
                return;
            }
        }

        // end Goldi animation

        // Stop the Game in the first frame after collision
        if (frames == 0)
        {
            List <GameObject> giveBorder = GameObject.Find("ObstacleSpawner").GetComponent <ObstacleSpawner>().tubes;
            for (int i = giveBorder.Count; i > 0; i--)
            {
                if (giveBorder[i - 1] != null)
                {
                    giveBorder[i - 1].GetComponent <ObstacleMover>().SetYBorder(Camera.main.ScreenToWorldPoint(new Vector3(0, 0, 0)).y);
                }
            }
            GameObject.Find("Score").GetComponent <ScoreUpdater>().counting          = false;
            GameObject.Find("Player").GetComponent <Rigidbody2D>().gravityScale      = 0;
            GameObject.Find("Player").GetComponent <Player_Move>().playerInitialized = false;
            GameObject.Find("Player").GetComponent <Rigidbody2D>().velocity          = new Vector2(0, 0);
            GameObject.Find("Player").GetComponent <Player_Move>().gameStoped        = true;
            //GameObject.Find("Background").GetComponent<BG_Move>().speed = 0;
            GameObject.Find("Foreground").GetComponent <BG_Move>().speed = 0;
            GameObject.Find("ObstacleSpawner").GetComponent <ObstacleSpawner>().active = false;
            int          temp = -1;
            ScoreUpdater scr  = GameObject.Find("Score").GetComponent <ScoreUpdater>();
            temp = scr.GetScore();
            if (DataManagement.highscore < temp)
            {
                DataManagement.highscore = temp;
            }
            WriteStats();
        }

        // count frames
        frames++;
    }
Example #23
0
 protected override void Start()
 {
     base.Start();
     score = GameObject.FindGameObjectWithTag("Score").GetComponent <ScoreUpdater>();
     cargo = GameObject.FindGameObjectWithTag("Cargo").GetComponent <CargoUpdater>();
 }
Example #24
0
 //bananas
 void Start()
 {
     gc  = GameObject.Find("Game Controller");
     scr = gc.GetComponent <ScoreUpdater>();
     //hand = GameObject.Find("PitchSpawnPosition").GetComponent<PitchSpawner>();
 }
Example #25
0
    private void Update()
    {
        if (gameObject.transform.position.y <= URLPlayerCfg.transform.position.y)
        {
            for (int i = 0; i < URLPlayerCfg.SizeY; i++)
            {
                for (int j = 0; j < URLPlayerCfg.SizeX; j++)
                {
                    if (gameObject.transform.position.x >= URLPlayerCfg.transform.position.x)
                    {
                        for (int a = 0; a < URLFigureCfg.SizeX; a++)
                        {
                            if (gameObject.transform.position.x + (20 * a) <= URLPlayerCfg.transform.position.x + (20 * URLPlayerCfg.SizeX))
                            {
                                if (isLive)
                                {
                                    if (URLFigureCfg.Num == URLPlayerCfg.NeedNum)
                                    {
                                        XMLReader.Instance().NextWave(PlayZone.CurrentZonePlay);
                                        ScoreUpdater.Instance().Score++;
                                        ScoreUpdater.Instance().UpdScore();
                                    }
                                    else
                                    {
                                        ScoreUpdater.Instance().YouLose();
                                    }
                                    isLive = false;
                                    foreach (var Temp in MetaData.Instance().AllLiveFigures)
                                    {
                                        Destroy(Temp, 0.05f);
                                    }
                                    MetaData.Instance().AllLiveFigures.Clear();
                                }
                            }
                        }
                    }
                    else if (gameObject.transform.position.x <= URLPlayerCfg.transform.position.x)
                    {
                        for (int a = 0; a < URLFigureCfg.SizeX; a++)
                        {
                            if (gameObject.transform.position.x + (20 * a) >= URLPlayerCfg.transform.position.x)
                            {
                                if (isLive)
                                {
                                    if (URLFigureCfg.Num == URLPlayerCfg.NeedNum)
                                    {
                                        XMLReader.Instance().NextWave(PlayZone.CurrentZonePlay);
                                        ScoreUpdater.Instance().Score++;
                                        ScoreUpdater.Instance().UpdScore();
                                    }
                                    else
                                    {
                                        ScoreUpdater.Instance().YouLose();
                                    }

                                    isLive = false;
                                    foreach (var Temp in MetaData.Instance().AllLiveFigures)
                                    {
                                        Destroy(Temp, 0.05f);
                                    }
                                    MetaData.Instance().AllLiveFigures.Clear();
                                }
                            }
                        }
                    }
                }
            }
        }
    }
Example #26
0
 public void changePoints(int points)
 {
     currentPoints += points;
     ScoreUpdater.setPoints(currentPoints);
 }
Example #27
0
 // Use this for initialization
 void Start()
 {
     score          = GameObject.FindGameObjectWithTag("ScoreBoard").GetComponent <ScoreUpdater>();
     targetRotation = transform.rotation;
 }
Example #28
0
 private void Start()
 {
     _scoreUpdater = FindObjectOfType <ScoreUpdater>();
 }
Example #29
0
 public override void Initialize()
 {
     scoreUpdater = GetComponent <ScoreUpdater>();
     startPos     = transform.position;
 }