示例#1
0
    public void Draw()
    {
        _screen.ColumnOrderSprite();
        //_screen.RowOrderSprite();

        // air supply
        for (int x = 0; x < 10; x++)
        {
            _screen.SetAttribute(x, 17, 7, 2);
        }

        for (int x = 10; x < 32; x++)
        {
            _screen.SetAttribute(x, 17, 7, 4);
        }


        byte[] airBlock = { 0, 0, 255, 255, 255, 255, 0, 0 };

        var airSupplyLength = _data.AirSupply.Length;
        var airHead         = _data.AirSupply.Tip;

        for (int x = 0; x < airSupplyLength; x++)
        {
            _screen.DrawSprite(x + 4, 17, 1, 1, airBlock);
        }

        byte[] airTipBlock = new byte[] { 0, 0, (byte)airHead, (byte)airHead, (byte)airHead, (byte)airHead, 0, 0 };
        _screen.DrawSprite(4 + airSupplyLength, 17, 1, 1, airTipBlock);

        _screen.PrintMessage(0, 17, "AIR");
    }
示例#2
0
    public void Draw()
    {
        _screen.ColumnOrderSprite();
        //_screen.RowOrderSprite();

        // KEYS
        byte[] keyShape = new byte[] { 255, 255, 255, 255, 255, 255, 255, 255 };
        foreach (var key in _data.RoomKeys)
        {
            if (key.Attr == 255)
            {
                continue;
            }

            int attr = _data.Attributes[key.Position.Y * 32 + key.Position.X];
            attr &= 0xF8; // 11111000
            attr |= key.Attr;

            //screen.SetAttribute(key.Position.X, key.Position.Y, key.Attr, 0, true, false);
            Com.SloanKelly.ZXSpectrum.ZXAttribute attribute = new Com.SloanKelly.ZXSpectrum.ZXAttribute((byte)attr);
            _screen.SetAttribute(key.Position.X, key.Position.Y, attribute);

            //screen.DrawSprite(key.Position.X, key.Position.Y, 1, 1, keyShape);
            _screen.DrawSprite(key.Position.X, key.Position.Y, 1, 1, _data.KeyShape);
        }
        // /KEYS
    }
    public void Draw()
    {
        // room title
        for (int x = 0; x < 32; x++)
        {
            _screen.SetAttribute(x, 16, 0, 6);
        }

        _screen.PrintMessage(0, 16, _data.RoomName);
    }
    public void Draw()
    {
        _screen.ColumnOrderSprite();
        //_screen.RowOrderSprite();

        // Score
        for (int x = 0; x < 32; x++)
        {
            _screen.SetAttribute(x, 19, 6, 0);
        }

        //screen.PrintMessage(0, 19, string.Format(ScoreFormat, hiScore, score));
        string playerScore = string.Format(ScoreFormat, _data.HiScore, _data.Score);

        _screen.PrintMessage(0, 19, playerScore);
        // /Score
    }
示例#5
0
    public void Draw()
    {
        _screen.ColumnOrderSprite();
        //_screen.RowOrderSprite();

        for (int py = 0; py < 2; py++)
        {
            for (int px = 0; px < 2; px++)
            {
                _screen.SetAttribute(_data.Portal.X + px, _data.Portal.Y + py, _data.Portal.Attr);
            }
        }

        _screen.RowOrderSprite();
        _screen.DrawSprite(_data.Portal.X, _data.Portal.Y, 2, 2, _data.Portal.Shape);

        _screen.ColumnOrderSprite();
    }
示例#6
0
    public void Draw()
    {
        _screen.ColumnOrderSprite();

        for (int y = 0; y < 16; y++)
        {
            for (int x = 0; x < 32; x++)
            {
                //int attr = data.Attributes[y,x];
                int attr = _data.Attributes[y * 32 + x];

                if (attr != 0)
                {
                    if (!_data.Blocks.ContainsKey(attr))
                    {
                        continue;                                  // hack for room #19
                    }
                    //Sprite block = data.Blocks[attr];

                    /*
                     * GameObject go = new GameObject(string.Format("({0}, {1})", x, y));
                     *
                     * var sr = go.AddComponent<SpriteRenderer>();
                     * sr.sprite = block;
                     * sr.material = pixelPerfect;
                     *
                     * go.transform.SetParent(target);
                     *
                     * //go.transform.position = new Vector3(x * 8, y * 8, 0);
                     * //go.transform.localPosition = new Vector3(x*8, -192 + y*8, 0);
                     * //go.transform.localPosition = new Vector3(x * 8, -128 + y * 8, 0);
                     * go.transform.localPosition = new Vector3(x * 8, y * -8, 0);
                     */

                    // AddSprite(string.Format("({0}, {1})", x, y), new Vector3(x, y), block);

                    int  ink      = attr.GetInk();
                    int  paper    = attr.GetPaper();
                    bool bright   = attr.IsBright();
                    bool flashing = attr.IsFlashing();

                    _screen.SetAttribute(x, y, ink, paper, bright, flashing);
                    //screen.DrawSprite(x, y, 1, 1, data.Blocks[attr]);

                    if (_data.Blocks[attr].Type == BlockType.Conveyor)
                    {
                        _screen.DrawSprite(x, y, 1, 1, _data.ConveyorShape);
                    }
                    else
                    {
                        _screen.DrawSprite(x, y, 1, 1, _data.Blocks[attr].Shape);
                    }
                }
            }
        }

        _data.Portal.Attr.Flashing = true; // Flashing!!!

        //screen.SetAttribute(data.Portal.X, data.Portal.Y, data.Portal.Attr);
        //screen.DrawSprite(data.Portal.X, data.Portal.Y, 2, 2, data.Portal.Shape);
    }