Ejemplo n.º 1
0
        public void Draw(SpriteBatch spriteBatch, IsometricTile tile)
        {
            int yOff = 32;             // how much to displace actor up from tile (may not want this to be uniform...

            foreach (int ID in tile.ActorList)
            {
                SpriteClass actor = new SpriteClass(tile.X, tile.Y - (yOff * scale), scale);

                if (ID == TURTLE)
                {
                    actor.texture = turtle;
                }

                if (ID == TURTLEGANG)
                {
                    actor.texture = turtleGang;
                }

                if (ID == BADGER)
                {
                    actor.texture = badger;
                }

                // TODO try/catch for null texture, cause that can totally happen if ID is invalid
                actor.Draw(spriteBatch);
            }
        }
Ejemplo n.º 2
0
 public void Draw(SpriteBatch spriteBatch, IsometricTile tile)
 {
     if (tile.TextureID == GRASS)
     {
         grass.Draw(spriteBatch);
     }
 }
Ejemplo n.º 3
0
 public void DrawTiles(SpriteBatch spriteBatch)
 {
     for (int y = 0; y < yLength; y++)
     {
         for (int x = 0; x < xLength; x++)
         {
             IsometricTile curr = tileMap[x, y, 0];
             if (curr.TextureID == 1)
             {
                 grass.X = curr.X;
                 grass.Y = curr.Y;
                 grass.Draw(spriteBatch);
             }
         }
     }
 }