Esempio n. 1
0
 void Start()
 {
     if (platformType.Equals(PlatformType.Movement))
     {
         StartCoroutine("PlatformMove");
     }
 }
Esempio n. 2
0
 private void Start()
 {
     setColliders(gameObject.GetComponents <BoxCollider2D>());
     if (!type.Equals(PlatformType.Static))
     {
         transform.localPosition = positions[0];
     }
     nextPosIndex = 1;
     loop         = !this.CompareTag("TriggerPlatform");
 }
Esempio n. 3
0
    PlatformType[] GenerateFastWaveFromPrevious(PlatformType[] prevWave)
    {
        //For each previous platform create new "wave"
        PlatformType[] wave = new PlatformType[6];

        for (int i = 0; i < prevWave.Length; i++)
        {
            PlatformType prevPlatform = prevWave[i];
            //If previous platform is normal
            if (prevPlatform.Equals(PlatformType.Normal))
            {
                //Check for bounds
                if (i == 0)
                {
                    wave[i + 1] = PlatformType.Normal;
                }
                else if (i == (prevWave.Length - 1))
                {
                    wave[i - 1] = PlatformType.Normal;
                }
                else
                {
                    wave[i - 1] = PlatformType.Normal;
                    wave[i + 1] = PlatformType.Normal;
                }
            }
        }
        return(wave);
    }
 public void UpdateFSA(PlatformType type, int index = -1)
 {
     if (type.Equals(PlatformType.Triggerable) && (CurrentIndex == index - 1 || !WentOnNeutro && CurrentIndex.Equals(index)))
     {
         CurrentIndex = index;
         WentOnNeutro = false;
     }
     else if (type.Equals(PlatformType.Triggerable))
     {
         CurrentIndex = 0;
         WentOnNeutro = false;
     }
     else if (type.Equals(PlatformType.Neutro))
     {
         WentOnNeutro = true;
     }
 }
Esempio n. 5
0
        public override Platform Create(PlatformType platformType, double left, double top)
        {
            var id = Guid.NewGuid().ToString(); //will use guid to map with graphic objects

            if (platformType.Equals(PlatformType.StandardPlatform))
            {
                Debug.WriteLine("Created standard platform");
                return(new StandardPlatform(id, left, top, 8));
            }
            if (platformType.Equals(PlatformType.SpringyPlatform))
            {
                Debug.WriteLine("Created springy platform");
                return(new SpringyPlatform(id, left, top, 8));
            }
            if (platformType.Equals(PlatformType.FragilePlatform))
            {
                Debug.WriteLine("Created fragile platform");
                return(new FragilePlatform(id, left, top, 8));
            }
            return(null);
        }
Esempio n. 6
0
        void ProcessImageCopy(ResizeImageInfo img, DpiPath originalScaleDpi, ConcurrentBag <ResizedImageInfo> resizedImages)
        {
            var resizer = new Resizer(img, IntermediateOutputPath, this);

            LogDebugMessage($"Copying {img.Filename}");

            var r = resizer.CopyFile(originalScaleDpi, InputsFile, PlatformType.Equals("android", StringComparison.OrdinalIgnoreCase));

            resizedImages.Add(r);

            LogDebugMessage($"Copied {img.Filename}");
        }
Esempio n. 7
0
    PlatformType[]  GenerateNormalWaveFromPrevious(PlatformType[] prevWave)
    {
        //For each previous platform create new "wave"
        PlatformType[] wave = new PlatformType[6];

        for (int i = 0; i < prevWave.Length; i++)
        {
            PlatformType prevPlatform = prevWave[i];
            //If previous platform is normal
            if (prevPlatform.Equals(PlatformType.Normal))
            {
                //Check for bounds
                if (i == 0)
                {
                    wave[i + 1] = PlatformType.Normal;
                }
                else if (i == (prevWave.Length - 1))
                {
                    wave[i - 1] = PlatformType.Normal;
                }
                else
                {
                    //If exists only on the left (on the right isnt possible)
                    if (wave[i - 1].Equals(PlatformType.Normal))
                    {
                        wave[i + 1] = (PlatformType)Random.Range(0, 2);
                        wave[i + 1] = Random.value <= doubleNormalChance ? PlatformType.Normal : wave[i + 1];
                    }
                    //If doesn't exists, then create 1-2
                    else
                    {
                        //Random create left platform
                        wave[i - 1] = (PlatformType)Random.Range(0, 3);
                        wave[i - 1] = Random.value <= addChance ? PlatformType.Normal : wave[i - 1];
                        //if left platform is normal
                        if (wave[i - 1] == PlatformType.Normal)
                        {
                            wave[i + 1] = (PlatformType)Random.Range(0, 2);
                            wave[i + 1] = Random.value <= doubleNormalChance ? PlatformType.Normal : wave[i + 1];
                        }
                        else
                        {
                            wave[i + 1] = PlatformType.Normal;
                        }
                    }
                }
            }
        }
        return(wave);
    }