Ejemplo n.º 1
0
    void Awake()
    {
        GameLevelMaker.InitLevels();
        GameLevel gameLevel = GameLevelMaker.GetLevel(0);

        ScrollingObject.SetScrollSpeeds(gameLevel);
        RandomObjectPool.SetSpawnTimes(gameLevel);
    }
Ejemplo n.º 2
0
        void OnCollect(ScrollingObject scrollingObject)
        {
            scrollingObject.Stop();

            m_onCollected?.Invoke(this);

            m_poolManager.ReturnPoolItem(this);
        }
Ejemplo n.º 3
0
        void OnExtinguish(ScrollingObject scrollingObject)
        {
            scrollingObject.Stop();

            m_onExtinguished?.Invoke(this);

            m_poolManager.ReturnPoolItem(this);
        }
Ejemplo n.º 4
0
        public override void OnAllocate()
        {
            base.OnAllocate();

            m_scrollingObject = gameObject.GetComponent <ScrollingObject>();

            m_coinPlayer.SetClip(0);
            m_coinPlayer.Play();
        }
Ejemplo n.º 5
0
 void Start()
 {
     rb2d   = GetComponent <Rigidbody2D> ();
     anim   = GetComponent <Animator> ();
     sound  = GetComponent <AudioSource> ();
     scroll = GetComponent <ScrollingObject> ();
     PlayerPrefs.SetInt("Dead", 0);
     PlayerPrefs.SetInt("Pause", 0);
 }
Ejemplo n.º 6
0
 public void SelectChunk()
 {
     if (currentScrollObject == null)
     {
         currentScrollObject = GetComponent <ScrollingObject>();
     }
     lastSelectedChunck       = chunks.GetRandom();
     currentScrollObject.size =
         lastSelectedChunck.GetComponent <ScrollingObject>().size;
 }
Ejemplo n.º 7
0
    public void SelectChunk()
    {
        if (currentScrollObject == null)
        {
            currentScrollObject = GetComponent <ScrollingObject> ();
        }

        lastSelectedChunk = chunks.GetRandom();
        //Pega o tamanho do chunck atual
        currentScrollObject.size = lastSelectedChunk.GetComponent <ScrollingObject> ().size;
    }
Ejemplo n.º 8
0
        public override void OnAllocate()
        {
            base.OnAllocate();

            m_scrollingObject = gameObject.GetComponent <ScrollingObject>();

            m_firePlayerIndex = Random.Range(0, m_firePlayers.Length);
            m_firePlayers[m_firePlayerIndex].gameObject.SetActive(true);
            m_firePlayers[m_firePlayerIndex].SetClip(0);
            m_firePlayers[m_firePlayerIndex].Play();
        }
Ejemplo n.º 9
0
    // Initialize
    void Start()
    {
        WEP          = GetComponent <WeightedEnemyPhysics> ();
        WEP.maxSpeed = circleSpeed;
        SR           = GetComponentInChildren <SpriteRenderer> ();
        SR.sprite    = AsleepSprite;
        SO           = GetComponent <ScrollingObject> ();
        SO.enabled   = true;

        chasing = false;
        angry   = false;
    }
Ejemplo n.º 10
0
 private void Start()
 {
     tag = "Enemy";
     rb  = gameObject.AddComponent <Rigidbody2D>();
     rb.freezeRotation = true;
     rb.mass           = 50f;
     rb.gravityScale   = 8f;
     gameObject.AddComponent <BoxCollider2D>().size    = new Vector2(1f, 2f);
     gameObject.GetComponent <BoxCollider2D>().offset  = Vector2.zero;
     gameObject.AddComponent <SpriteRenderer>().sprite = Resources.Load("CharacterSprites/Enemies/Goblin", typeof(Sprite)) as Sprite;
     defaultScrolling = gameObject.AddComponent <ScrollingObject>();
     defaultScrolling.SetAutoMove(autoMove);
 }
Ejemplo n.º 11
0
    public void SelectChunk()
    {
        if (currentScrollObject == null)
        {
            currentScrollObject = GetComponent <ScrollingObject> ();
        }

        lastSelectedChunk = chunks.GetRandom();
        // Pega o tamanho do chunk atual
        currentScrollObject.size =
            lastSelectedChunk.GetComponent <ScrollingObject> ().size;
        //currentScrollObject.GetComponent<Transform>().rotation = new Quaternion (0f,0f,Random.Range(0f,360f),0f);
    }
Ejemplo n.º 12
0
        public override void OnAllocate()
        {
            base.OnAllocate();

            m_scrollingObject = gameObject.GetComponent <ScrollingObject>();

            for (int i = 0; i < EasterEggs.Length; i++)
            {
                EasterEggs[i].SetActive(false);
            }

            //allocate an easter egg
            //EasterEggs[Random.Range(0, EasterEggs.Length)].SetActive(true);
        }
Ejemplo n.º 13
0
    private void LosePower(PowerType powerType)
    {
        powerTimes [(int)powerType] = noOpVal;

        switch (powerType)
        {
        case PowerType.RapidFire:
            FirePoop.LosePower();
            break;

        case PowerType.StopTime:
            ScrollingObject.LoseSlowTime();
            break;

        default:
            break;
        }
    }
Ejemplo n.º 14
0
    public void GainPower(PowerType powerType)
    {
        powerTimes [(int)powerType] = powerDurations [(int)powerType];

        switch (powerType)
        {
        case PowerType.RapidFire:
            FirePoop.GainPower();
            break;

        case PowerType.StopTime:
            ScrollingObject.GainSlowTime();
            break;

        default:
            break;
        }
    }
Ejemplo n.º 15
0
 private void UpdateLevelStuff(GameLevel newLevel)
 {
     gameLevel = newLevel;
     ScrollingObject.SetScrollSpeeds(newLevel);
     RandomObjectPool.SetSpawnTimes(newLevel);
 }