Exemple #1
0
 // Use this for initialization
 void Start()
 {
     playerState = this.GetComponent <PlayerStatus>();
     saveScript  = this.GetComponent <SaveScript>();
     scoreText   = this.GetComponent <ScoreText>();
     //gameObject.SetActive(false);
 }
Exemple #2
0
    public static void deleteRow(int y)
    {
        gameScoreDisplay       = GameObject.Find("Score").GetComponent <ScoreText> ();
        gameScoreDisplay.score = gameScoreDisplay.score + 100;

        lineSound = GameObject.Find("Line sound").GetComponent <AudioSource> ();
        lineSound.Play();

        for (int x = 0; x < w; ++x)
        {
            if (grid [x, y] != null)
            {
                if (grid [x, y].gameObject.name == "blocklightning")
                {
                    specialblocks [x] = 1;
                }
                else if (grid [x, y].gameObject.name == "blockaquaattack")
                {
                    specialblocks [x] = 2;
                }
                else if (grid [x, y].gameObject.name == "blockgravity")
                {
                    specialblocks [x] = 3;
                }
                else if (grid [x, y].gameObject.name == "blockaquasupport")
                {
                    specialblocks [x] = 4;
                }
                Destroy(grid [x, y].gameObject);
                grid [x, y] = null;
            }
        }
    }
Exemple #3
0
    protected override bool DeathFunc()
    {
        if (time <= 0.0f)
        {
            this.gameObject.GetComponent <Collider2D>().enabled = false;

            // スコア加算
            GameController.Instance.AddScore(scorePoint);

            // スコアテキスト表示
            Text      text    = Instantiate(scoreTextObj).GetComponent <Text>();
            ScoreText textScr = text.GetComponent <ScoreText>();
            textScr.SetScore(scorePoint);
            text.transform.SetParent(GameObject.Find("Canvas").transform, false);
            text.transform.localScale  *= 1.5f;
            text.rectTransform.position = RectTransformUtility.WorldToScreenPoint(Camera.main, this.transform.position);

            // 死亡演出コルーチン開始
            StartCoroutine(nameof(DeathDirecting));
            time = 1.0f;
        }

        if (endDeath)
        {
            return(true);
        }
        else
        {
            // 敵弾消去
            GameController.Instance.DeleteAllEBullets();
            return(false);
        }
    }
Exemple #4
0
 void FixedUpdate()
 {
     // Increase time
     Manager.time += Time.fixedDeltaTime;
     // Update the UI
     text.text = ScoreText.toTime(Manager.time);
 }
Exemple #5
0
    void CheckLose()
    {
        if (BeekeeperScore >= EndBeeKeeperScore)
        {
            // LOSE
            menuLose.SetActive(true);
            //Debug.Log("Lost");
            GenerateHexes board = FindObjectOfType <GenerateHexes>();
            board.HideCost();
            HoneyGatheredScore      = HoneyGathered * 10;
            TotalHoneyGatheredScore = TotalHoneyGathered;
            totalBeesScore          = totalBees * 20;
            ActiveHexesScore        = ActiveHexes * 125;
            BeekeeperMinusScore     = -BeekeeperScore * 50;
            timePassedMinusScore    = -(int)timePassed * 2;;

            EndScore = HoneyGatheredScore + TotalHoneyGatheredScore + totalBeesScore + ActiveHexesScore + BeekeeperMinusScore + timePassedMinusScore - 1000;

            ScoreText scoreText = FindObjectOfType <ScoreText>();
            scoreText.GetComponent <TextMesh>().text = EndScore.ToString();

            Time.timeScale = 0f;
        }
        else
        {
            return;
        }
    }
Exemple #6
0
 // Use this for initialization
 void Start()
 {
     currentKills = GameObject.FindGameObjectWithTag("GameManager").GetComponent <KillsAmount>();
     scoreText    = GameObject.FindGameObjectWithTag("GameManager").GetComponent <ScoreText>();
     data         = FindObjectOfType <VariableData>();
     lives        = data.GetEnemyHealth();
 }
Exemple #7
0
        private void InitializeGame()
        {
            scoreText = new ScoreText();

            levelText = new LevelText();

            realTimeText = new RealTimeText();

            AssetPool.statsSprite.Position = new Vector2f(AssetPool.holdSprite.Position.X,
                                                          realTimeText.Position.Y + AssetPool.blockSize.Y);

            statsTextBlock = new StatsTextBlock();

            controlsText.Position = new Vector2f(AssetPool.queueSprite.Position.X,
                                                 AssetPool.queueSprite.Position.Y + AssetPool.queueTexture.Size.Y + AssetPool.blockSize.Y);

            //Select a new active piece
            NewPiece();

            //Add the piece to the grid, with a movement of 0,0
            grid.AddPiece(activePiece, new Vector2i(0, 0));

            AssetPool.drawGridSprite.Position = new Vector2f(GridUI.position.X - AssetPool.blockSize.X * 1.5f,
                                                             GridUI.position.Y - AssetPool.blockSize.Y * 2f);
        }
Exemple #8
0
 private void Start()
 {
     rb              = snowBoard.GetComponent <Rigidbody2D>();
     music           = FindObjectOfType <MusicController>();
     sceneController = FindObjectOfType <SceneTransitionController>();
     scoreText       = FindObjectOfType <ScoreText>();
 }
Exemple #9
0
 void Start()
 {
     player = GameObject.Find("unitychan");
     money  = GameObject.Find("ScoreText");
     sT     = money.GetComponent <ScoreText>();
     CreateWall();
 }
Exemple #10
0
    // Use this for initialization
    void Start()
    {
        resultScore = ScoreText.getScore();
        animator    = player.GetComponent <Animator>();

        if (Player.getDeathFlg())
        {
            s = "GAME OVER";
            resultText.setResult(s);
            animator.SetBool("sad", true);
        }
        else
        {
            if (resultScore > happyScore)
            {
                s = "GAME COMPLETE";
                resultText.setResult(s);
                animator.SetBool("happy", true);
            }
            else
            {
                s = "GAME CLEAR";
                resultText.setResult(s);
                animator.SetBool("soso", true);
            }
        }
    }
Exemple #11
0
    void Start()
    {
        if (!Menu)
        {
            if (SceneManager.GetActiveScene().name == "Level01")
            {
                FindObjectOfType <TileMap> ().BuildMesh(1);
                FindObjectOfType <TileMap> ().BuildMesh(1);
            }
            else if (SceneManager.GetActiveScene().name == "Level02")
            {
                FindObjectOfType <TileMap> ().BuildMesh(2);
                FindObjectOfType <TileMap> ().BuildMesh(2);
            }
            resetMngr = FindObjectOfType(typeof(ResetManager)) as ResetManager;

            score  = GameObject.Find("ScoreText");
            scoreT = score.GetComponent <ScoreText> ();
            rstpp  = player.GetComponent <ResetPlayerParameters> () as ResetPlayerParameters;


            GameOver = gmOver.GetComponent <Image> () as Image;
            newbst   = newBest.GetComponent <Image> () as Image;

            LevelComplete = lvlcomplete.GetComponent <Text> () as Text;
            lvlcmpOverlay = lvlcompoverlay.GetComponent <Text> () as Text;

            cmpRe = compRe.GetComponent <Button> () as Button;
            cpRe  = cpRestart.GetComponent <Button> () as Button;

            _comp   = compRe.GetComponent <Image> () as Image;
            _checkp = cpRestart.GetComponent <Image> () as Image;
        }
    }
Exemple #12
0
    void OnTileBreak(DrillAttackInfo info)
    {
        PlayerResources resources = info.attacker.GetComponent <PlayerResources>();

        if (resources)
        {
            int current = resources.GetResourceCount(type);
            int score   = resources.Score;
            resources.SetResourceCount(type, current + amount);
            int newCount = resources.GetResourceCount(type);

            if (current != newCount && info.attacker.CompareTag("Player"))
            {
                // Changed, so need popup text
                Vector3    position = Camera.main.WorldToScreenPoint(transform.position);
                Transform  parent   = GameObject.Find("Canvas").transform;
                GameObject popup    = Instantiate(onBreakPopup, position, Quaternion.identity, parent);
                ScoreText  text     = popup.GetComponent <ScoreText>();
                switch (type)
                {
                case ResourceType.Oil:
                    text.Text = "Drill Speed!";
                    break;

                default:
                    text.Text = "+" + (resources.Score - score);
                    break;
                }
            }
        }
    }
Exemple #13
0
    void Start()
    {
        m_Transform         = transform;
        m_CameraTransform   = Camera.main.transform;
        m_PlayerTransform   = GameObject.FindGameObjectWithTag("Player").transform;
        m_EnemiesTransform  = GameObject.FindGameObjectWithTag("Enemies").transform;
        m_ShieldsTransform  = GameObject.FindGameObjectWithTag("Shields").transform;
        m_InGameUITransform = m_Transform.GetChild(3);

        m_PlayerController = m_PlayerTransform.gameObject.GetComponent <PlayerController>();
        m_EnemyController  = m_EnemiesTransform.gameObject.GetComponent <EnemyController>();
        m_ShieldController = m_ShieldsTransform.gameObject.GetComponent <ShieldController>();
        m_LivesText        = GetComponentInChildren <LivesText>();
        m_ScoreText        = GetComponentInChildren <ScoreText>();
        m_LevelText        = GetComponentInChildren <LevelText>();

        m_OriginalCameraPosition = m_CameraTransform.position;
        m_StartMenu       = m_Transform.GetChild(0).gameObject;
        m_GameOverMenu    = m_Transform.GetChild(1).gameObject;
        m_PauseMenu       = m_Transform.GetChild(2).gameObject;
        m_InGameUI        = m_Transform.GetChild(3).gameObject;
        m_ExplosionPrefab = Resources.Load <GameObject>("Prefabs/Explosion");

        m_CanPause = false;
        DisableInGameUI();
    }
Exemple #14
0
    // 死亡時処理 消滅時に true を返す
    protected override bool DeathFunc()
    {
        if (time <= 0.0f)
        {
            // スコア加算
            GameController.Instance.AddScore(scorePoint);

            // スコアテキスト表示
            Text      text    = Instantiate(scoreTextObj).GetComponent <Text>();
            ScoreText textScr = text.GetComponent <ScoreText>();
            textScr.SetScore(scorePoint);
            text.transform.SetParent(GameObject.Find("Canvas").transform, false);
            text.rectTransform.position = RectTransformUtility.WorldToScreenPoint(Camera.main, this.transform.position);

            // 爆破エフェクト設置
            GameObject eff = EffectManager.Instance.InstantiateEffect(EffectManager.Effects.Explosion, this.transform.position);
            eff.transform.localScale = new Vector2(0.8f, 0.8f);

            // 効果音再生
            RandomExpSE_Big();
        }

        death = true;
        return(true);
    }
Exemple #15
0
 // Start is called before the first frame update
 void Start()
 {
     SpriteNum  = 0;
     renderer   = GetComponent <SpriteRenderer>();
     Score_Text = ScoreObj.GetComponent <ScoreText>();
     ScalePoint = 1.0f;
 }
Exemple #16
0
        public override void Initialize(FObjectInitializer initializer)
        {
            base.Initialize(initializer);

            RootComponent = initializer.CreateDefaultSubobject <USceneComponent>(this, new FName("DummyRoot"));

            ScoreText = initializer.CreateDefaultSubobject <UTextRenderComponent>(this, new FName("ScoreText"));
            ScoreText.RelativeLocation = new FVector(320, 60, 0);
            ScoreText.RelativeRotation = new FRotator(90, 0, 0);
            ScoreText.RelativeScale3D  = new FVector(4, 4, 4);
            ScoreText.AttachToComponent(RootComponent, FName.None, EAttachmentRule.KeepRelative, EAttachmentRule.KeepRelative, EAttachmentRule.KeepRelative, false);

            // Care needs to be taken when dealing with FText. In C++ FText lifetime is automatically managed via shared pointers.
            // Any FText which has a lifetime maintained by C# (FText.OwnsReference==true) needs to be destroyed manually. This can be
            // done via by calling 'Dispose()', or in a 'using' statement. If neither is used, the finalizer will do the clean up when
            // the C# GC runs.
            using (FText text = FText.FromString("Score: 0"))
            {
                ScoreText.SetText(text);

                // - text needs to be disposed as the lifetime is maintained by C#
                // - ScoreText.Text doesn't need to be disposed as the lifetime is maintained by native code
                Debug.Assert(text.OwnsReference && !ScoreText.Text.OwnsReference);
            }
        }
        public override IReadOnlyList <IEntity> Run(bool initialise)
        {
            if (initialise)
            {
                // Initialise scene graph.
                sceneGraph = new MapSceneGraph();

                // Create pong text entity.
                RenderText pongText = (RenderText)entityProvider.RequestEntity <RenderText>(new Vector3(Game.GameWidth / 2 - 40, 50, 0));
                pongText.Text   = "MEGA PONG";
                pongText.Colour = Color.Black;
                AddEntity(pongText);

                // Create player 1 score entity.
                ScoreText player1Score = (ScoreText)entityProvider.RequestEntity <ScoreText>(new Vector3(50, 50, 0));
                player1Score.Player = 1;
                player1Score.Colour = Color.Black;
                AddEntity(player1Score);

                // Create player 2 score entity.
                ScoreText player2Score = (ScoreText)entityProvider.RequestEntity <ScoreText>(new Vector3(Game.GameWidth - 75, 50, 0));
                player2Score.Player = 2;
                player2Score.Colour = Color.Black;
                AddEntity(player2Score);
            }

            return(base.Run(initialise));
        }
Exemple #18
0
 private static void ProcessScoreboardVisibility(ScoreText score)
 {
     if (DateTime.Now.Subtract(score.LastIncrease).Seconds >= ScoreboardSecondsVisibility)
     {
         score.Enabled = false;
     }
 }
Exemple #19
0
 // Start is called before the first frame update
 void Start()
 {
     scoreController = GameObject.FindGameObjectWithTag("ScoreController").GetComponent <ScoreText>();
     player          = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerController>();
     an = GetComponent <Animator>();
     rb = GetComponent <Rigidbody>();
 }
Exemple #20
0
    // Update is called once per frame
    void Update()
    {
        if (previousScore != Score) //save perf from non needed calculations
        {
            ScoreText.GetComponent <Text>().text = Score.ToString();

            if (Score % 10 == 0 && Score != 0)
            {
                levelText.GetComponent <Text>().text = "Level Up ++";
                Score += 2;
                Invoke("Wait", 2f);
            }


            //if (Score < 10)
            //{
            //    //just draw units
            //    //Units.sprite = numberSprites[Score];
            //}
            //else if(Score >= 10 && Score < 100)
            //{
            //   // (Tens.gameObject as GameObject).SetActive(true);
            //    //Tens.sprite = numberSprites[Score / 10];
            //   // Units.sprite = numberSprites[Score % 10];
            //}
            //else if(Score >= 100)
            //{
            //   // (Hundreds.gameObject as GameObject).SetActive(true);
            //   // Hundreds.sprite = numberSprites[Score / 100];
            //   // int rest = Score % 100;
            //   // Tens.sprite = numberSprites[rest / 10];
            //  //  Units.sprite = numberSprites[rest % 10];
            //}
        }
    }
 // Use this for initialization
 void Start()
 {
     //シーン中のGameOverTextオブジェクトを取得
     this.gameoverText = GameObject.Find("GameOverText");
     this.scoreText    = GameObject.Find("GameScore").GetComponent <ScoreText>();
     this.rigid        = GetComponent <Rigidbody>();
 }
Exemple #22
0
 private void CreateHud()
 {
     scoreText           = new ScoreText();
     scoreText.PositionX = 10;
     scoreText.PositionY = hudLayer.ContentSize.Height - 30;
     scoreText.Score     = 0;
     hudLayer.AddChild(scoreText);
 }
Exemple #23
0
 private void Update()
 {
     ScoreText.GetComponent <Text>().text = "score: " + Score;
     if (Score == 25)
     {
         EnemyType2.SetActive(true);
     }
 }
Exemple #24
0
 void Start()
 {
     arduino = GameObject.FindGameObjectWithTag("Arduino").GetComponent <ArduinoManger>();
     if (instance == null)
     {
         instance = this;
     }
 }
Exemple #25
0
    public void addScoreText(TextMesh scoreTextE)
    {
        ScoreText sc = new ScoreText();

        sc.curTime_ = 0;
        sc.setText(scoreTextE);
        //Debug.Log("SC:" + scoreTextList);
        scoreTextList.Add(sc);
    }
Exemple #26
0
 // Use this for initialization
 void Start()
 {
     //        test = (ScoreText)GameObject.Find("Counter").GetComponent<Text>();
     //        test1.GetComponent<Text>();
     test1  = GameObject.Find("Counter");
     test   = test1.GetComponent <ScoreText>();
     effect = GameObject.Find("TapEffect").GetComponent <ParticleSystem>();
     se     = this.GetComponent <AudioSource>();
 }
Exemple #27
0
 private void Awake()
 {
     _rigidbody   = GetComponent <Rigidbody>();
     _boxCollider = GetComponent <BoxCollider>();
     SetBoxCollider(true);
     Vibration.Init();
     _moneyText = GameObject.FindWithTag("Money").GetComponent <SetText>();
     _scoreText = GameObject.FindWithTag("Score").GetComponent <ScoreText>();
 }
Exemple #28
0
    void Start()
    {
        _spawnManager = FindObjectOfType <SpawnManager>();
        _audioManager = FindObjectOfType <AudioManager>();
        _scoreText    = FindObjectOfType <ScoreText>();
        _rb           = GetComponent <Rigidbody2D>();

        _rb.AddForce(new Vector2(Random.Range(-5f, 5f), Random.Range(-5f, 5f)) * speed, ForceMode2D.Impulse);
    }
 // Use this for initialization
 void Start()
 {
     pauseMenu.enabled      = false;
     Music                  = GetComponent <AudioSource> ();
     atmosphere             = GameObject.FindGameObjectWithTag("Player").GetComponentsInChildren <AudioSource> ();
     Music.clip             = musicLoop;
     gameOverCanvas.enabled = false;
     scoreScript            = scoreScript.GetComponent <ScoreText>();
 }
Exemple #30
0
 // Use this for initialization
 void Start()
 {
     rd2D    = GetComponent <Rigidbody2D>();
     player  = GameObject.FindGameObjectWithTag("Player");
     anim    = GetComponent <Animator>();
     col2D   = GetComponent <Collider2D>();
     ScoreUI = GameObject.FindGameObjectWithTag("Score");
     ST      = ScoreUI.GetComponent <ScoreText>();
 }
Exemple #31
0
    void Start () {
        audioSource = gameObject.GetComponent<AudioSource>();
        score = GameObject.Find ("Score").GetComponent<ScoreText>();
		life = GameObject.Find ("Lifeber").GetComponent<Life> ();
	}
Exemple #32
0
    void Start()
    {
        foxScore = 0;
        skunkScore = 0;
        bearScore = 0;
        rabbitScore = 0;

        foxButtons = 0;
        skunkButtons = 0;
        bearButtons = 0;
        rabbitButtons = 0;

        first = "Fox";
        second = "Skunk";
        third = "Bear";
        fourth = "Rabbit";

        countDownText = countDownTimerCanvas.GetComponent<ScoreText> ();

        countDownText.isHidden = true;

        GameObject sunsetImg = GameObject.FindGameObjectWithTag("SunsetFilter");

        if (sunsetImg) {
            float alpha = sunsetImg.GetComponent<Renderer>().material.color.a;
            Color newColor = new Color(1, 1, 1, 0.0f);
            sunsetImg.GetComponent<SpriteRenderer>().material.color = newColor;
            Debug.Log ("Hiding sunset map");
        }

        sunSet = false;
        darknessSet = false;
        darknessFaded = false;
        everythingSetDark = false;
        gameOver = false;
    }
Exemple #33
0
 void Start () {
     playmode = GameObject.Find("EventSystem").GetComponent<playmode>();
     score = GameObject.Find("Score").GetComponent<ScoreText>();
     //テキストの位置調整
     gameObject.transform.position = new Vector3(gameObject.transform.position.x+10f, gameObject.transform.position.y+10f, 0);
 }
Exemple #34
0
	void Start () {
        ausrc = gameObject.GetComponent<AudioSource>();
        score = GameObject.Find ("Score").GetComponent<ScoreText>();
		life = GameObject.Find ("Lifeber").GetComponent<Life> ();
        playmode = GameObject.Find("EventSystem").GetComponent<playmode>();
	}
Exemple #35
0
    private void SelectButton()
    {
        scoreSelected = scoreTextList[atualButtonPos];
        selector.transform.localPosition = new Vector3(scoreSelected.transform.localPosition.x,scoreSelected.transform.localPosition.y,selector.transform.localPosition.z);

        if(atualButtonPos > posToChangePag)
        {
            Hashtable args = new Hashtable();
            args["y"] = 2.5 +(5.5f * Mathf.FloorToInt(atualButtonPos / quantToSlideScores));
            args["time"] = 0.3f;
            args["easetype"] = iTween.EaseType.linear;
            iTween.MoveTo(allScoresParent.gameObject,args);

            posToChangePag += quantToSlideScores;
        }
        else if(atualButtonPos < posToChangePag - 5)
        {
            Hashtable args = new Hashtable();
            args["y"] = 2.5+(5.5f * Mathf.FloorToInt(atualButtonPos / quantToSlideScores));
            args["time"] = 0.3f;
            args["easetype"] = iTween.EaseType.linear;
            iTween.MoveTo(allScoresParent.gameObject,args);

            posToChangePag -= quantToSlideScores;
        }
    }