Example #1
0
        protected virtual ColorCycle[] ReadCYCL()
        {
            var colorCycle = new ColorCycle[16];

            for (int i = 0; i < 16; i++)
            {
                var delay = ScummHelper.SwapBytes(_reader.ReadUInt16());
                var start = _reader.ReadByte();
                var end   = _reader.ReadByte();

                colorCycle[i] = new ColorCycle();

                if (delay == 0 || delay == 0x0aaa || start >= end)
                {
                    continue;
                }

                colorCycle[i].Counter = 0;
                colorCycle[i].Delay   = (ushort)(16384 / delay);
                colorCycle[i].Flags   = 2;
                colorCycle[i].Start   = start;
                colorCycle[i].End     = end;
            }

            return(colorCycle);
        }
        public BlackholeCustomColors(string colorsMild, string colorsWild, string bgColorInner, string bgColorOuterMild, string bgColorOuterWild) : base()
        {
            blackholeData = new DynData <BlackholeBG>(this);

            // parse all color cycles.
            cycleColorsMild       = new ColorCycle(colorsMild, 0.8f);
            cycleColorsWild       = new ColorCycle(colorsWild);
            cycleBgColorInner     = new ColorCycle(bgColorInner);
            cycleBgColorOuterMild = new ColorCycle(bgColorOuterMild);
            cycleBgColorOuterWild = new ColorCycle(bgColorOuterWild);
        }
Example #3
0
    void Start()
    {
        colorCycler = GetComponent <ColorCycle>();

        upSpr   = PurchaseManager.Instance.Costumes[PurchaseManager.Instance.PlayerCostume - 1].GetFrame1();
        downSpr = PurchaseManager.Instance.Costumes[PurchaseManager.Instance.PlayerCostume - 1].GetFrame2();
        if (PurchaseManager.Instance.Costumes[PurchaseManager.Instance.PlayerCostume - 1].isSpecial)
        {
            colorCycler.enabled = true;
        }
        else
        {
            colorCycler.enabled = false;
        }
        audioSource = GetComponent <AudioSource>();
        //grapplingHook.gameObject.SetActive(false);
        cam     = Camera.main;
        RB2d    = GetComponent <Rigidbody2D>();
        SprRend = GetComponent <SpriteRenderer>();
        mask    = LayerMask.GetMask("Wall");
    }
Example #4
0
        protected override ColorCycle[] ReadCYCL()
        {
            int j;
            var cycle = new List <ColorCycle>();

            while ((j = _reader.ReadByte()) != 0)
            {
                if (j < 1 || j > 16)
                {
                    throw new NotSupportedException(string.Format("Invalid color cycle index {0}", j));
                }
                var cycl = new ColorCycle();
                cycle.Add(cycl);

                _reader.ReadUInt16();

                cycl.Counter = 0;
                cycl.Delay   = (ushort)(16384 / _reader.ReadUInt16BigEndian());
                cycl.Flags   = _reader.ReadUInt16BigEndian();
                cycl.Start   = _reader.ReadByte();
                cycl.End     = _reader.ReadByte();
            }
            return(cycle.ToArray());
        }
Example #5
0
        protected virtual ColorCycle[] ReadCYCL()
        {
            var colorCycle = new ColorCycle[16];
            for (int i = 0; i < 16; i++)
            {
                var delay = ScummHelper.SwapBytes(_reader.ReadUInt16());
                var start = _reader.ReadByte();
                var end = _reader.ReadByte();

                colorCycle[i] = new ColorCycle();

                if (delay == 0 || delay == 0x0aaa || start >= end)
                    continue;

                colorCycle[i].Counter = 0;
                colorCycle[i].Delay = (ushort)(16384 / delay);
                colorCycle[i].Flags = 2;
                colorCycle[i].Start = start;
                colorCycle[i].End = end;
            }

            return colorCycle;
        }
Example #6
0
        protected override ColorCycle[] ReadCYCL()
        {
            int j;
            var cycle = new List<ColorCycle>();
            while ((j = _reader.ReadByte()) != 0)
            {
                if (j < 1 || j > 16)
                {
                    throw new NotSupportedException(string.Format("Invalid color cycle index {0}", j));
                }
                var cycl = new ColorCycle();
                cycle.Add(cycl);

                _reader.ReadUInt16();

                cycl.Counter = 0;
                cycl.Delay = (ushort)(16384 / _reader.ReadUInt16BigEndian());
                cycl.Flags = _reader.ReadUInt16BigEndian();
                cycl.Start = _reader.ReadByte();
                cycl.End = _reader.ReadByte();
            }
            return cycle.ToArray();
        }