Ejemplo n.º 1
0
 private void RpcShowSprite(eSprite type)
 {
     if (!isClient)
     {
         return;
     }
     ShowSprite(type);
 }
Ejemplo n.º 2
0
 public void AddSprite(eSprite _spr, int _x, int _y, int _z, float _scale, float _angle, eSpriteFlags _flags)
 {
     Sprite spr = new Sprite();
     spr.x = _x & 0xff;
     spr.y = _y & 0xff;
     spr.z = _z & 0x3ff;
     spr.scale = _scale;
     spr.angle = _angle;
     spr.flags = _flags;
     sprites.Add(spr);
 }
Ejemplo n.º 3
0
        public void AddSprite(eSprite _spr, int _x, int _y, int _z, float _scale, float _angle, eSpriteFlags _flags)
        {
            Sprite spr = new Sprite();

            spr.x     = _x & 0xff;
            spr.y     = _y & 0xff;
            spr.z     = _z & 0x3ff;
            spr.scale = _scale;
            spr.angle = _angle;
            spr.flags = _flags;
            sprites.Add(spr);
        }
Ejemplo n.º 4
0
        // #############################################################################################
        /// Function:<summary>
        ///             Add a building at connected locations using _colour to identify on the map
        ///             and make a the building between min and max sizes using _block as the block.
        ///          </summary>
        ///
        /// In:		<param name="_x">X Coordinate</param>
        ///			<param name="_y">y Coordinate</param>
        ///			<param name="_col"></param>
        ///			<param name="min"></param>
        ///			<param name="_max"></param>
        ///			<param name="_block"></param>
        ///
        // #############################################################################################
        private void AddTrees(int _x, int _y, int _groundlevel, int _col, eSprite _sprite)
        {
            List <Coords> FinalList = GetCoordList(_x, _y, (UInt32)_col);

            foreach (Coords c in FinalList)
            {
                Set(c.x / TileWidth, c.y / TileWidth, GroundLevel, Grass);
                int xx = rand.Next(-16, 16);
                int yy = rand.Next(-16, 16);
                AddSprite(c.x + 32 + xx, c.y + 32 + yy, _groundlevel + 16, _sprite);
            }
        }
Ejemplo n.º 5
0
    private void ShowSprite(eSprite type)
    {
        HidleAllSprite();
        switch (type)
        {
        case eSprite.Idle:
            _spriteIdle.enabled = true;
            break;

        case eSprite.Run:
            _spriteRun.enabled = true;
            break;
        }
    }
Ejemplo n.º 6
0
        // #############################################################################################
        /// Function:<summary>
        ///             Add a sprite to the map
        ///          </summary>
        ///
        /// In:		<param name="_x"></param>
        ///			<param name="_y"></param>
        ///			<param name="_z"></param>
        ///			<param name="_sprite"></param>
        ///
        // #############################################################################################
        void AddSprite(int _x, int _y, int _z, eSprite _sprite)
        {
            // First work out the cell we're in
            int           gx     = _x / TileWidth;
            int           gy     = _y / TileHeight;
            List <Sprite> column = map[gx + (gy * Width)].sprites;
            Sprite        sp     = new Sprite();

            sp.x          = _x % TileWidth;
            sp.y          = _y % TileHeight;
            sp.z          = _z;
            sp.scale      = 0;
            sp.flags      = eSpriteFlags.none;
            sp.angle      = 0;
            sp.SpriteType = _sprite;
            column.Add(sp);
        }
Ejemplo n.º 7
0
 // #############################################################################################
 /// Function:<summary>
 ///          	Add a building at connected locations using _colour to identify on the map
 ///          	and make a the building between min and max sizes using _block as the block.
 ///          </summary>
 ///
 /// In:		<param name="_x">X Coordinate</param>
 ///			<param name="_y">y Coordinate</param>
 ///			<param name="_col"></param>
 ///			<param name="min"></param>
 ///			<param name="_max"></param>
 ///			<param name="_block"></param>
 ///
 // #############################################################################################
 private void AddTrees(int _x, int _y, int _groundlevel, int _col, eSprite _sprite)
 {
     List<Coords> FinalList = GetCoordList(_x, _y, (UInt32)_col);
     foreach (Coords c in FinalList)
     {
         Set(c.x / TileWidth, c.y / TileWidth, GroundLevel, Grass);
         int xx = rand.Next(-16,16);
         int yy = rand.Next(-16,16);
         AddSprite(c.x + 32+xx, c.y+32+yy, _groundlevel+16, _sprite);
     }
 }
Ejemplo n.º 8
0
 // #############################################################################################
 /// Function:<summary>
 ///          	Add a sprite to the map
 ///          </summary>
 ///
 /// In:		<param name="_x"></param>
 ///			<param name="_y"></param>
 ///			<param name="_z"></param>
 ///			<param name="_sprite"></param>
 ///
 // #############################################################################################
 void AddSprite(int _x, int _y, int _z, eSprite _sprite)
 {
     // First work out the cell we're in
     int gx = _x / TileWidth;
     int gy = _y / TileHeight;
     List<Sprite> column = map[gx + (gy * Width)].sprites;
     Sprite sp = new Sprite();
     sp.x = _x % TileWidth;
     sp.y = _y % TileHeight;
     sp.z = _z;
     sp.scale = 0;
     sp.flags = eSpriteFlags.none;
     sp.angle = 0;
     sp.SpriteType = _sprite;
     column.Add(sp);
 }
Ejemplo n.º 9
0
 private void CmdShowSprite(eSprite type)
 {
     RpcShowSprite(type);
 }