private static void RenderEntities(GameEngine engine, GraphicsRenderer renderer, GameTime gameTime,
                                    List <CoreAbstractEntity> entities, ClientMapTile onTile, float tileDrawX, float tileDrawY)
 {
     foreach (CoreAbstractEntity entity in entities)
     {
         EntityRenderer entityRenderer = EntityRenderers.Get(entity);
         entityRenderer.Render(engine, renderer, gameTime, entity, onTile, tileDrawX, tileDrawY);
     }
 }
    //Use this to receive the message from the Server on the Client's side
    public void ReceiveMessage(NetworkMessage networkMessage)
    {
        //Read the message that comes in
        UpdateHostMessage hostMessage = networkMessage.ReadMessage <UpdateHostMessage>();

        ClientMapTile tile = GameObject.Find(hostMessage.identifier).GetComponent <ClientMapTile>();

        if (tile != null)
        {
            tile.NetworkUpdate(hostMessage.list);
            tile.SetTex(hostMessage.texture);
        }
        ((ClientMapBuilder)mapBuilder).AddTile(tile);
    }
示例#3
0
        internal static void Render(GameEngine engine, GraphicsRenderer renderer, GameTime gameTime, ClientMapTile tile, float x, float y)
        {
            SpriteAnimation tileAnimation = MapTileTextures.GetById(tile.Id);

            renderer.Render(tileAnimation, x, y, offsetY: tile.HeightOffset);
        }
示例#4
0
 internal static void Update(GameEngine engine, GameTime gameTime, ClientMapTile tile)
 {
 }
示例#5
0
        public override void Render(GameEngine engine, GraphicsRenderer renderer, GameTime gameTime, CoreAbstractEntity entity, ClientMapTile onTile, float drawX, float drawY)
        {
            // TODO: Temporary testing
            ClientPlayerUnit unit         = (ClientPlayerUnit)entity;
            SpriteAnimation  animation    = unit.Textures.GetAnimation(PlayerUnitAnimationType.Idle);
            Vector2          position     = unit.ScreenPosition;
            Color            factionColor = unit.Player.FactionColor;

            float height = ClientMapTile.TILE_HEIGHT / 4 + unit.SpriteSize.Height - onTile.HeightOffset;

            renderer.Render(animation, position.X, position.Y, offsetY: -height, mask: factionColor);
        }
示例#6
0
 public abstract void Render(GameEngine engine, GraphicsRenderer renderer, GameTime gameTime, CoreAbstractEntity entity, ClientMapTile onTile, float drawX, float drawY);