Example #1
0
 // Start is called before the first frame update
 void Start()
 {
     PaturuControy.NameSet();
     sg = false;
     TName();
     Drag                 = true;
     drag2                = true;
     DestoyCount          = 0;
     timer                = Keeptimer;
     DestoySize           = -1;
     SwichType            = false;
     DeleteList           = new List <GameObject>();
     _min                 = GetComponent <Mian>();
     CScorecount          = GetComponent <ScoreCount>();
     CLine                = GetComponent <LineRender>();
     lineSize             = 0;
     linePosCount         = 0;
     Tag_ColorControlName = null;
     Back                 = false;
     m_SoundManager       = GameObject.Find("GameSoundManager").GetComponent <GameSoundManager>();
     //PaturuControy.Skill.Water6Swich = false;
     PaturuControy.waterskill_six.UpdaterCountDown = false;
     PaturuControy.ColorUpadateCtr = false;
     SkillCostManager.Skill_Control.Water6Swich = false;
 }
Example #2
0
        public float Median()
        {
            List <int> Numbers = new List <int>();

            for (int i = 1; i < ScoreCount.Count(); i++)
            {
                for (int j = 0; j < ScoreCount[i]; j++)
                {
                    Numbers.Add(i);
                }
            }
            if (Numbers.Count == 0)
            {
                return(0);
            }
            int HalfIndex = Numbers.Count() / 2;

            if (Numbers.Count() % 2 == 0)
            {
                return((float)(Numbers[HalfIndex] + Numbers[HalfIndex - 1]) / 2);
            }
            else
            {
                return(Numbers[HalfIndex]);
            }
        }
    public int Max_Points = 3; //Setting Maximum points to 3


    void Start()
    {
        instance = this;

        P1_Score = 0; //Initialising both variables to 0
        P2_Score = 0;
    }
Example #4
0
 void Start()
 {
     gameManager = GameObject.Find("GameManager").GetComponent<GameManager>().instance;
     scoreCount = gameObject.GetComponent<ScoreCount> ();
     rb = GetComponent<Rigidbody> ();
     //scoreAudio = GameObject.Find("audioScore").GetComponent<AudioSource>();
 }
Example #5
0
        public void Score_ReturnsInitialScoreOfZero()
        {
            var scores = new ScoreCount(4);

            for (int i = 0; i < 4; i++)
            {
                Assert.AreEqual(0, scores.Score(i));
            }
        }
    public IEnumerator LoadGameScene()
    {
        yield return(new WaitForSeconds(1f));

        SceneManager.LoadScene(1);
        scoreCount = FindObjectOfType <ScoreCount>();
        scoreCount.ResetScore();
        Debug.Log("hmmmm");
    }
Example #7
0
    // Start is called before the first frame update
    void Start()
    {
        GameObject gameManagerObj = GameObject.Find("GameManager");

        gameStatusEnum   = GameObject.Find("GameManager").GetComponent <GameStatusEnum>();
        uiGameOverScript = GameObject.Find("GameManager").GetComponent <UI_GameOver>();
        startPosition    = this.transform.position;
        scoreCountScript = GameObject.Find("GameManager").GetComponent <ScoreCount>();
    }
Example #8
0
 void Start()
 {
     obj2      = new List <GameObject>();
     AllPaturu = new List <GameObject>();
     NumberInitalize();
     ObjInitalize();
     PaturuInitalize();
     PaturuDown(BeginSize);
     SkillScore = this.GetComponent <ScoreCount>();
 }
Example #9
0
    // Use this for initialization
    void Start()
    {
        direction = (target - myTransform.position).normalized;
        GameObject gameObject = GameObject.FindGameObjectWithTag("ScoreText");

        if (gameObject != null)
        {
            scoreCount = gameObject.GetComponent <ScoreCount>();
        }
    }
Example #10
0
 void OnCollisionEnter(Collision col)
 {
     if (col.gameObject.name == "Bullet")
     {
         GameObject text           = GameObject.Find("ScoreText");
         ScoreCount countComponent = text.GetComponent <ScoreCount>();
         countComponent.updateText();
     }
     Destroy(gameObject);
 }
Example #11
0
    void Start()
    {
        GameObject gameObject = GameObject.FindGameObjectWithTag("ScoreText");

        changeMusic = (ChangeMusic)GameObject.FindGameObjectWithTag("Smelly").GetComponent("ChangeMusic");
        if (gameObject != null)
        {
            scoreCount = gameObject.GetComponent <ScoreCount>();
        }
    }
    public IEnumerator LoadMenuScene()
    {
        yield return(new WaitForSeconds(1f));

        SceneManager.LoadScene(0);
        scoreCount = FindObjectOfType <ScoreCount>();
        scoreCount.ResetScore();
        Destroy(scoreCount.gameObject);
        Debug.Log("hmmmsafam");
    }
Example #13
0
    private void Awake()
    {
        entryTemplate.gameObject.SetActive(false);

        score7  = FindObjectOfType <ScoreCount>();
        inWind2 = FindObjectOfType <inputWindow>();

        highscoreEntryList = new List <HighscoreEntry>()
        {
            new HighscoreEntry {
                score = 8, name = "AAA"
            },
            new HighscoreEntry {
                score = 50, name = "CAR"
            },
            new HighscoreEntry {
                score = 31, name = "DAN"
            },
            new HighscoreEntry {
                score = 25, name = "LJR"
            },
            new HighscoreEntry {
                score = 13, name = "GRE"
            },
        };


        //loading - (y = x) -
        Highscores highscoresL = new Highscores {
            highscoreEntryList = highscoreEntryList
        };


        //Sort entry list by Score
        for (int i = 0; i < highscoresL.highscoreEntryList.Count; i++)
        {
            for (int j = i + 1; j < highscoresL.highscoreEntryList.Count; j++)
            {
                if (highscoresL.highscoreEntryList[j].score > highscoresL.highscoreEntryList[i].score)
                {
                    //swap
                    HighscoreEntry tmp = highscoresL.highscoreEntryList[i];
                    highscoresL.highscoreEntryList[i] = highscoresL.highscoreEntryList[j];
                    highscoresL.highscoreEntryList[j] = tmp;
                }
            }
        }


        highscoreEntryTransformList = new List <Transform>();
        foreach (HighscoreEntry highscoreEntry in highscoresL.highscoreEntryList)
        {
            CreateHighscoreEntryTransform(highscoreEntry, entryContainer, highscoreEntryTransformList);
        }
    }
Example #14
0
    // Use this for initialization
    void Start()
    {
        ScoreCount oldCount = FindObjectOfType <ScoreCount> ();

        score = 0;
        if (oldCount)
        {
            score = oldCount.score;
            Destroy(oldCount.gameObject);
        }
    }
Example #15
0
    private void Start()
    {
        Cursor.visible = false;
        scoreCount     = FindObjectOfType <ScoreCount>();
        mAudioSrc      = GetComponent <AudioSource>();

        levelHandler = FindObjectOfType <LevelHandler>();

        source1 = GameObject.FindGameObjectWithTag("Enemy").GetComponent <AudioSource>();
        source2 = GameObject.FindGameObjectWithTag("Friendly").GetComponent <AudioSource>();
    }
Example #16
0
    //public GameObject mainCamera;


    // Use this for initialization
    void Start()
    {
        Debug.Log(PhotonNetwork.connectionState);
        PhotonNetwork.Disconnect();
        if (GameObject.FindGameObjectWithTag("GameData") == null)
        {
            Instantiate(gData);
            data = GameObject.FindGameObjectWithTag("GameData").GetComponent <RoomData>();
            if (data.roomName == "T3STROOM")
            {
                overrideLobbyMax = true;
            }
            if (!overrideLobbyMax)
            {
                lobbyMax = data.numberOfPlayers;
            }
        }
        else
        {
            data = GameObject.FindGameObjectWithTag("GameData").GetComponent <RoomData>();
            if (data.roomName == "T3STROOM1")
            {
                data.numberOfPlayers = 1;
            }
            if (data.roomName == "T3STROOM2")
            {
                data.numberOfPlayers = 2;
            }
            if (!overrideLobbyMax)
            {
                lobbyMax = data.numberOfPlayers;
            }
        }

        PhotonNetwork.sendRate = 20;
        PhotonNetwork.logLevel = PhotonLogLevel.Full;
        PhotonNetwork.ConnectUsingSettings("0.1");
        roomDetails            = new RoomOptions();
        roomDetails.IsVisible  = false;
        roomDetails.MaxPlayers = (byte)lobbyMax;
        typedLobby             = new TypedLobby();

        //ships = GameObject.FindGameObjectsWithTag("Ship");


        defaultRoundStartTimer = roundStartTimer;

        scoreData = GameObject.FindGameObjectWithTag("ScoreData").GetComponent <ScoreCount>();

        if (scoreData == null)
        {
            Debug.Log("SCORE DATA: Data could not be found! Is there a Score Data object in the scene?");
        }
    }
Example #17
0
        public void Add_IsCumulative()
        {
            var scores = new ScoreCount(4);

            scores.Add(2, new[] { new Card(CardType.Blue, 1, 4) });
            scores.Add(2, new[] { new Card(CardType.Blue, 1, 3) });
            Assert.AreEqual(7, scores.Score(2));
            Assert.AreEqual(0, scores.Score(0));
            Assert.AreEqual(0, scores.Score(1));
            Assert.AreEqual(0, scores.Score(3));
        }
Example #18
0
    void Start()
    {
        GameObject go = GameObject.FindGameObjectWithTag("Player");

        target = go.transform;
        GameObject gameObject = GameObject.FindGameObjectWithTag("ScoreText");

        if (gameObject != null)
        {
            scoreCount = gameObject.GetComponent <ScoreCount>();
        }
    }
Example #19
0
 // Update is called once per frame
 void Update()
 {
     // Debug.Log("GuiScoreboard updating...");
     TimeText.text      = TimeLabel + NewLine + GameTimers[ActiveTimer].ShowElapsed();
     HitsText.text      = HitsLabel + NewLine + HitsCount.ToString();
     MarkHitsText.text  = MarkHitsLabel + NewLine + MarkHitsCount.ToString();
     KillsText.text     = KillsLabel + NewLine + KillsCount.ToString();
     MarkKillsText.text = MarkKillsLabel + NewLine + MarkKillsCount.ToString();
     AmmoText.text      = AmmoLabel + NewLine + AmmoCount.ToString();
     ScoreText.text     = ScoreLabel + NewLine + ScoreCount.ToString("D5");
     PlaceText.text     = PlaceLabel + NewLine + PlaceCount.ToString();
     MarkPlaceText.text = MarkPlaceLabel + NewLine + MarkPlaceCount.ToString();
 }
Example #20
0
        public int Dominant()
        {
            int modal = 1;

            for (int i = 2; i < ScoreCount.Count(); i++)
            {
                if (ScoreCount[i] > ScoreCount[modal])
                {
                    modal = i;
                }
            }
            return(modal);
        }
    void Start()
    {
        theScoreManager = FindObjectOfType <ScoreCount>();
        spawning        = FindObjectOfType <MapGen>();
        inWind          = FindObjectOfType <inputWindow>();
        rigidbody       = GetComponent <Rigidbody2D>();
        downRotation    = Quaternion.Euler(0, 0, -90);
        forwardRotation = Quaternion.Euler(0, 0, 35);
        game            = GameManager.Instance;

        inWind.input.transform.position = new Vector3(inWind.input.transform.position.x, inWind.input.transform.position.y + 50, 0);

        rnd = Random.Range(-1, 5);
    }
Example #22
0
        public float Avg()
        {
            int Total = 0;

            for (int i = 1; i < ScoreCount.Count(); i++)
            {
                Total += i * ScoreCount[i];
            }
            if (Total == 0)
            {
                return(0);
            }
            return((float)Total / TotalScoreCount);
        }
Example #23
0
    void Start()
    {
        GameObject gameObject = GameObject.FindGameObjectWithTag("ScoreText");

        if (gameObject != null)
        {
            scoreCount = gameObject.GetComponent <ScoreCount>();
        }
        gameObject = GameObject.FindGameObjectWithTag("GameController");
        if (gameObject != null)
        {
            generator = gameObject.GetComponent <WorldGenerator>();
        }
    }
Example #24
0
    // Start is called before the first frame update
    void Start()
    {
        mainDataScript          = GameObject.Find("PlayerData").GetComponent <MainData>();
        gameStatusEnum          = GameObject.Find("GameManager").GetComponent <GameStatusEnum>();
        scoreCount              = GameObject.Find("GameManager").GetComponent <ScoreCount>();
        topScoreScript          = this.gameObject.GetComponent <UI_TopScore>();
        barrierStartSpawnScript = GameObject.Find("BarrierSpawnManager").GetComponent <BarrierStartSpawn>();

        startPlayerPosition = playerNextPosition.transform.position; //positionAt start

        touchInputScript = inputHolder.GetComponent <TouchInput>();

        mainGameManagerScript = this.gameObject.GetComponent <GameManagerMain>();
    }
Example #25
0
    // Use this for initialization
    void Start()
    {
        this.destroyable = true;
        System.Random random = new System.Random();
        int           rand   = random.Next(2);

        this.whichHand = rand == 1 ? "Left" : "Right";
        this.GetComponentInChildren <MeshRenderer>().material = Resources.Load(this.whichHand) as Material;


        this.sounds = GetComponents <AudioSource>();
        AudioSource.PlayClipAtPoint(this.sounds[rand].clip, this.transform.position);

        this.ScoreScript = GameObject.Find("Camera (eye)").GetComponent <ScoreCount>();
    }
Example #26
0
        public void Add_AddsScoreForCorrectPlayer()
        {
            var scores = new ScoreCount(4);
            var cards  = new[]
            {
                new Card(CardType.Blue, 1, 4),
                new Card(CardType.Blue, 1, 3)
            };

            scores.Add(2, cards);
            Assert.AreEqual(7, scores.Score(2));
            Assert.AreEqual(0, scores.Score(0));
            Assert.AreEqual(0, scores.Score(1));
            Assert.AreEqual(0, scores.Score(3));
        }
Example #27
0
    //Score goal and reset the ball
    void ScoreGoal(Collider2D collision)
    {
        if (collision.gameObject.name == "Left Goal")
        {
            scoreCount = GameObject.Find("Right Score").GetComponent <ScoreCount>();
            scoreCount.Score();
            StartCoroutine(Initialize());
        }

        else if (collision.gameObject.name == "Right Goal")
        {
            scoreCount = GameObject.Find("Left Score").GetComponent <ScoreCount>();
            scoreCount.Score();
            StartCoroutine(Initialize());
        }
    }
Example #28
0
    public void Die()
    {
        Destroy(gameObject);
        GameObject explosion = Instantiate(boomVfx, transform.position, Quaternion.identity);

        Destroy(explosion, 1f);
        AudioSource.PlayClipAtPoint(enemyDeadSound, Camera.main.transform.position, soundVolume);

        ScoreCount scoreCount = FindObjectOfType <ScoreCount>();

        scoreCount.AddToScore(scorePerOne);


        //AudioSource.PlayClipAtPoint
        //audioSource.play
        //audioSource.PlayOneShot
    }
Example #29
0
    void Start()
    {
        scoreCountScript = this.gameObject.GetComponent <ScoreCount>();
        gameStatusEnum   = GameObject.Find("GameManager").GetComponent <GameStatusEnum>();

        //spawnRoadManager = GameObject.Find("SkinShell").GetComponent<SpawnRoadManager>();

        stepsToSpawn = BarrierValueHolder.barrierValueHolder.stepsToSpawn;

        stepDistance = GameObject.Find("PlayerNextPosition").GetComponent <PlayerMove>().stepDistance;

        barrierStartSpawnScript = GameObject.Find("SkinShell").GetComponent <BarrierStartSpawn>();

        //Debug.Log($"desitance to spawn = {stepsToSpawn}");

        playerNextPosition    = GameObject.Find("PlayerNextPosition");
        playerCurrentPosition = GameObject.Find("PlayerCurrentPosition");
        startPlayerPosition   = playerNextPosition.transform.position;

        mainDataScript = MainData.mainDataScript;
    }
Example #30
0
    IEnumerator WaitTwoSecond(Collider col)
    {
        changeMusic.freezeGame = true;
        GameObject score      = GameObject.FindGameObjectWithTag("ScoreText");
        ScoreCount scoreCount = (ScoreCount)score.GetComponent("ScoreCount");

        changeMusic.PlayerDeath();
        yield return(new WaitForSeconds(2));

        changeMusic.restartMusic();
        col.transform.position = new Vector3(0, 0.1f, 1.3f);
        List <GameObject> badList = new List <GameObject>(GameObject.FindGameObjectsWithTag("BadGuy"));

        foreach (GameObject bad in badList)
        {
            AIScript script = (AIScript)bad.GetComponent("AIScript");
            script.frameBeforeStart = 300;
            bad.transform.position  = new Vector3(0, 1f, 0.3f);
        }
        scoreCount.updateLife(false);
        changeMusic.freezeGame = false;
    }
Example #31
0
    private void AddCount(ScoreCount scoretype, int arg0 = 1)
    {
        if (arg0 < 1)
        {
            return;
        }

        switch (scoretype)
        {
        case ScoreCount.Kill:
            ActiveScore.Kills += arg0;
            break;

        case ScoreCount.Treasure:
            ActiveScore.Treasures += arg0;
            break;

        case ScoreCount.GoblinInTribe:
            ActiveScore.GoblinsInTribe += arg0;
            break;

        case ScoreCount.AreaExplored:
            ActiveScore.AreasExplored += arg0;
            break;

        case ScoreCount.LeaderLevel:
            ActiveScore.LeaderLevel += arg0;
            break;

        case ScoreCount.Equipment:
            ActiveScore.EquipmentFound += arg0;
            break;

        default:
            throw new ArgumentOutOfRangeException(nameof(scoretype), scoretype, null);
        }
    }
Example #32
0
 // Use this for initialization
 void Start()
 {
     __countScore = __scoreCount.GetComponent<ScoreCount>();
     __skin = GetComponent<SpriteRenderer>();
     transform.position = __position;
     __skin.sprite = skin[Random.Range(0, skin.Length)];
     TimerDown = Timer;
 }
Example #33
0
 void Awake()
 {
     scoreCount = GameObject.Find("Score").GetComponent<ScoreCount>();
 }