Ejemplo n.º 1
0
 private static void LoadPlayer(String player, PlayableMainGameScreen PGS)
 {
     char[] delims = {'<','>'};
     String[] tokens = player.Substring(8).Split(delims);
     String texture = tokens[1];
     PlayerEntity pEntity;
     Vector2 playerPos = PGS.PlayerPos;
     pEntity = new PlayerEntity(texture, playerPos);
     PGS.AddEntity(pEntity);
 }
 public void AddEntity(DrawableEntity entity)
 {
     entity.OwnerScreen = this;
     entity.LoadContent();
     entities.Add(entity);
     if (entity is PlayerEntity)
         player = (PlayerEntity)entity;
 }
Ejemplo n.º 3
0
 private static void LoadPlayer(String player, PlayableMainGameScreen PGS)
 {
     char[] delims = {'<','>'};
     String[] tokens = player.Substring(8).Split(delims);
     String texture = tokens[1];
     float posX = float.Parse(tokens[3]);
     float posY = float.Parse(tokens[5]);
     PlayerEntity pEntity;
     Vector2 playerPos;
     if (PGS.PlayerPos.Equals(new Vector2(-1, -1)))
     {
         playerPos = new Vector2(posX, posY);
     }
     else
     {
         playerPos = PGS.PlayerPos;
     }
     pEntity = new PlayerEntity(texture, playerPos);
     PGS.AddEntity(pEntity);
 }