private void NewHost() { LevelGrid levelGrid = GameWorld.GetObject("tiles") as LevelGrid; if (levelGrid.DrawGridPosition(position) != gridPos) { host = levelGrid.NewPassenger(levelGrid.DrawGridPosition(position), gridPos, this, host); gridPos = levelGrid.DrawGridPosition(position); } else if (host != "") { (GameWorld.GetObject(host) as Tile).CheckPassengerPosition(this); } }
private void NewHost() { //become a passenger of a tile LevelGrid levelGrid = GameWorld.GetObject("levelgrid") as LevelGrid; //check if on new tile if (levelGrid.DrawGridPosition(position) != gridPos) { host = levelGrid.NewPassenger(levelGrid.DrawGridPosition(position), gridPos, this, host); gridPos = levelGrid.DrawGridPosition(position); } else if (host != "") { (GameWorld.GetObject(host) as Tile).CheckPassengerPosition(this); } }
public virtual void NewHost() { //become a passenger of a tile LevelGrid levelGrid = GameWorld.GetObject("levelgrid") as LevelGrid; //check if on new tile if (levelGrid.GridPosition(position) != gridpos) { drawHost = levelGrid.NewPassenger(position, gridpos, this, drawHost); gridpos = levelGrid.GridPosition(position); drawgridpos = levelGrid.DrawGridPosition(position); } else if (drawHost != "") { (GameWorld.GetObject(drawHost) as Tile).CheckDrawPassengerPosition(this); } }