Ejemplo n.º 1
0
        void loadTiles(FuzzyColor color)
        {
            switch (color)
            {
            case FuzzyColor.Black:
                this._rect[0] = new Rectangle(2, 2, 30, 28);
                this._rect[1] = new Rectangle(32, 2, 30, 28);
                this._rect[2] = new Rectangle(62, 2, 30, 28);
                this._rect[3] = new Rectangle(92, 2, 30, 28);
                break;

            case FuzzyColor.Yellow:
                this._rect[0] = new Rectangle(0, 32, 30, 28);
                this._rect[1] = new Rectangle(32, 32, 30, 28);
                this._rect[2] = new Rectangle(62, 32, 30, 28);
                this._rect[3] = new Rectangle(92, 32, 30, 28);
                break;

            case FuzzyColor.Green:
                this._rect[0] = new Rectangle(2, 64, 30, 28);
                this._rect[1] = new Rectangle(32, 64, 30, 28);
                this._rect[2] = new Rectangle(62, 64, 30, 28);
                this._rect[3] = new Rectangle(92, 64, 30, 28);
                break;
            }
        }
Ejemplo n.º 2
0
        public Fuzzy(Texture2D texture, World world, FuzzyColor color, Vector2 position)
            : base(texture, world, position)
        {
            this._width  = 26;
            this._height = 24;

            this._maxFrames = 4;
            this._rect      = new Rectangle[_maxFrames];

            this.loadTiles(color);

            this.InitPhysic(world, position);
        }